test_that("`max` is given when `sols` is NA", { expect_equal(ds_select_solutions(NULL, 1), 1) }) test_that("`max` is given when `max` is less than `sols`", { suppressMessages(expect_equal(ds_select_solutions(2, 1), 1)) }) test_that("`sols` is given when `sols` is less than `max`", { expect_equal(ds_select_solutions(1, 2), 1) }) test_that("results table are correct", { inf <- list( ncol = 5, solutions = 5, n_options = 5, stimuli = 5 ) val <- list( eigenval = seq(0, .8, .2), adj_eigenval = seq(0, .8, .2) ) expect_snapshot(ds_out_tbl(inf, val, 1)) expect_snapshot(ds_out_tbl(inf, val, 2)) expect_snapshot(ds_out_tbl(inf, val, 3)) expect_snapshot(ds_out_tbl(inf, val, 4)) expect_snapshot(ds_out_tbl(inf, val, 5)) expect_error(ds_out_tbl(inf, val, 6)) })