Skip to content

Commit

Permalink
wrote test to prevent this from happening again.
Browse files Browse the repository at this point in the history
  • Loading branch information
zkamvar committed May 12, 2015
1 parent 82eb32d commit 7c0523f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/testthat/test-values.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
})

0 comments on commit 7c0523f

Please sign in to comment.