Skip to content

Commit

Permalink
add test for filtered to original
Browse files Browse the repository at this point in the history
  • Loading branch information
zkamvar committed Aug 7, 2016
1 parent 01e4d19 commit 28d2be0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/testthat/test-msn.R
Expand Up @@ -167,6 +167,8 @@ test_that("Minimum spanning networks also collapse MLGs", {
gmsnot <- bruvo.msn(gend, replen = c(1, 1)) # no threshold supplied
gmsnone <- bruvo.msn(gend, replen = c(1, 1), threshold = 0.3)
expect_equal(igraph::vcount(gmsnone$graph), 1)
gmsnall <- bruvo.msn(gend, replen = c(1, 1), threshold = 0)
expect_equal(igraph::vcount(gmsnall$graph), 4)

expect_identical(igraph::V(gmsnt$graph)$pie, igraph::V(pgmsnt$graph)$pie)
expect_identical(igraph::V(gmsnot$graph)$pie, igraph::V(pgmsnt$graph)$pie)
Expand All @@ -183,8 +185,13 @@ test_that("Minimum spanning networks also collapse MLGs", {
pgmsn <- poppr.msn(gend, distmat = gend_bruvo, showplot = FALSE)

expect_identical(igraph::V(gmsn$graph)$pie, igraph::V(pgmsn$graph)$pie)
expect_identical(igraph::V(gmsn$graph)$pie, igraph::V(gmsnall$graph)$pie)

expect_identical(igraph::V(gmsn$graph)$name, igraph::V(pgmsn$graph)$name)
expect_identical(igraph::V(gmsn$graph)$name, igraph::V(gmsnall$graph)$name)

expect_identical(igraph::E(gmsn$graph)$weight, igraph::E(pgmsn$graph)$weight)
expect_identical(igraph::E(gmsn$graph)$weight, igraph::E(gmsnall$graph)$weight)

})

Expand Down

0 comments on commit 28d2be0

Please sign in to comment.