Closed vedhav closed 10 months ago
Good catch!!
It was still in time to be fixed on #184
testthat::test_that("c.join_key_set merges with empty and non-empty parents", {
jk1 <- join_keys(
join_key("d1", "d1", "a")
)
jk2 <- join_keys(
join_key("d3", "d3", "c"),
join_key("d4", "d4", "d"),
join_key("d4", "d3", "cd")
)
parents(jk2) <- list(d3 = "d4")
expected <- join_keys(
join_key("d1", "d1", "a"),
join_key("d3", "d3", "c"),
join_key("d4", "d4", "d"),
join_key("d3", "d4", "cd")
)
parents(expected) <- list(d3 = "d4")
testthat::expect_identical(
c(jk1, jk2),
expected
)
testthat::expect_equal(
c(jk2, jk1),
expected
)
})
#> Test passed 🥳
When a join_keys is merged using
c.join_keys
it's__parents__
attributed is not merged.