tests/testthat/test-remove_subsets.R

combo_list <- list(c(1,2,3,4), c(1,2,3,4,6), c(1,3,4,7))

# keeping superset
testthat::test_that("remove_subset: removes subset of longer superset",{
  testthat::expect_equal(remove_subsets(combo_list, keep_longest = TRUE),
               expected=list(c(1,2,3,4,6), c(1,3,4,7)))})
# keeping subset
testthat::test_that("remove_subset: removes superset of shorter subset",{
  testthat::expect_equal(remove_subsets(combo_list, keep_longest = FALSE),
               expected=list(c(1,2,3,4), c(1,3,4,7)))})

Try the exhaustiveRasch package in your browser

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

exhaustiveRasch documentation built on April 3, 2025, 6:18 p.m.