tests/testthat/test-union_closed.R

test_that("union_closed works", {
    l <- list(A = "1",
         B = c("1", "2"),
         C = c("2", "3", "4"),
         D = c("1", "2", "3", "4")
    )
    TS <- tidySet(l)
    expect_true(union_closed(TS))
    expect_false(union_closed(TS, sets = c("A", "C")))
    expect_false(union_closed(TS, sets = c("A", "B", "C")))
    expect_true(union_closed(TS, sets = c("A", "B", "C", "D")))
})

Try the BaseSet package in your browser

Any scripts or data that you put into this service are public.

BaseSet documentation built on April 12, 2025, 2:25 a.m.