diff --git a/R/default-scoring-rules.R b/R/default-scoring-rules.R index 849949dbd..8bee15987 100644 --- a/R/default-scoring-rules.R +++ b/R/default-scoring-rules.R @@ -16,7 +16,7 @@ #' ) select_rules <- function(rules, select = "all", exclude = NULL) { assert_character(x = c(select, exclude), null.ok = TRUE) - assert_list(rules, names = TRUE) + assert_list(rules, names = "named") allowed <- names(rules) if (select == "all" && is.null(exclude)) { diff --git a/tests/testthat/test-default-scoring-rules.R b/tests/testthat/test-default-scoring-rules.R index 206181f5b..853508ab3 100644 --- a/tests/testthat/test-default-scoring-rules.R +++ b/tests/testthat/test-default-scoring-rules.R @@ -5,6 +5,11 @@ test_that("`select_rules` works as expected", { rules_point() ) + expect_equal( + scoringutils:::select_rules(rules_point(), select = "all"), + scoringutils:::select_rules(rules_point()) + ) + expect_equal( names(scoringutils:::select_rules(rules_point(), select = "ape")), "ape"