Skip to content

Commit

Permalink
test: add test for no type conversion by disjoint_union()
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle authored and krlmlr committed Jun 20, 2024
1 parent 3c70e69 commit 6704594
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/test-operators.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ test_that("disjoint_union() works", {
)
})

test_that("disjoint_union() does not convert types", {
# https://github.com/igraph/rigraph/issues/761

g1 <- make_graph(~ A - -B)
g2 <- make_graph(~ D - -E)

g1 <- set_edge_attr(g1, "date", value = as.POSIXct(c("2021-01-01 01:01:01")))
g2 <- set_edge_attr(g2, "date", value = as.POSIXct(c("2021-03-03 03:03:03")))

u <- disjoint_union(g1, g2)

expect_s3_class(E(u)$date, c("POSIXct", "POSIXt"))
})

test_that("intersection() works", {

g1 <- make_ring(10)
Expand Down

0 comments on commit 6704594

Please sign in to comment.