From 7c0523feac694c665f89f8cb67baf6882b363cd7 Mon Sep 17 00:00:00 2001 From: Zhian Kamvar Date: Tue, 12 May 2015 11:17:25 -0700 Subject: [PATCH] wrote test to prevent this from happening again. --- tests/testthat/test-values.R | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/testthat/test-values.R b/tests/testthat/test-values.R index c81f603c..4607a070 100644 --- a/tests/testthat/test-values.R +++ b/tests/testthat/test-values.R @@ -59,4 +59,15 @@ test_that("Internal function fix_negative_branch works as expected.", { # clones were set to zero and the fix set the branch lengths in the correct # order. expect_equivalent(min(fix_tree$edge.length - the_tree$edge.length), min(the_tree$edge.length)) +}) + +test_that("mlg.matrix returns a matrix and not table", { + data(partial_clone) + mat4row <- poppr:::mlg.matrix(partial_clone) + pop(partial_clone) <- NULL + mat1row <- poppr:::mlg.matrix(partial_clone) + expect_that(mat4row, is_a("matrix")) + expect_that(mat1row, is_a("matrix")) + expect_that(mat1row, not(is_a("table"))) + expect_that(mat4row, not(is_a("table"))) }) \ No newline at end of file