-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Add tests for isomorphisms()
and subgraph_isomorphisms()
#1225
Conversation
Current Aviator status
This PR was merged using Aviator.
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
test_that("isomorphisms works", { | ||
motif <- make_empty_graph(directed = FALSE) + | ||
vertices("D1", "D2", type = c("type1", "type1")) + | ||
edges("D1", "D2", type = c("type2")) | ||
subgraph_isomorphisms( | ||
target = motif, pattern = motif, method = "vf2", | ||
vertex.color1 = 2:1, vertex.color2 = 1:2 | ||
) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type
attribute is unused here. It's not useless to test with target
and pattern
the same, but normally they should be different, and pattern
should be smaller.
For example, let target
be a make_ring(10,circular=T)
and pattern
a make_ring(5, circular=F)
.
Also, the title should say subgraph isomorphism.
test_that("subgraph_isomorphisms works", { | ||
motif <- make_empty_graph(directed = FALSE) + | ||
vertices("D1", "D2", type = c("type1", "type1")) + | ||
edges("D1", "D2", type = c("type2")) | ||
out <- subgraph_isomorphisms( | ||
target = motif, pattern = motif, method = "vf2", | ||
vertex.color1 = 2:1, vertex.color2 = 1:2 | ||
) | ||
expect_length(out, 1) | ||
expect_equal(as.numeric(out[[1]]), 2:1) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is near-identical to the first one, can the redundancy be reduced?
de169c4
to
374f78d
Compare
Follow-up to #1219.