Skip to content

Commit

Permalink
added tests for dictionary suggest
Browse files Browse the repository at this point in the history
  • Loading branch information
advieser committed Dec 1, 2024
1 parent 0027e3e commit 5099de7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/testthat/test_po.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,11 @@ test_that("Incrementing ids works", {
xs = pos(c("pca_1", "pca_2"))
assert_true(all(names(xs) == c("pca_1", "pca_2")))
})

test_that("po - dictionary suggest works", {

# test that correct dictionary is checked against
expect_error(po("robustify"), "ppl\\(\\): 'robustify'")
expect_error(pos("robustify"), "ppls\\(\\): 'robustify'")

})
10 changes: 9 additions & 1 deletion tests/testthat/test_ppl.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test_that("mlr_graphs access works", {
})


test_that("mlr_pipeops multi-access works", {
test_that("mlr_graphs multi-access works", {

expect_equal(
ppls("robustify"),
Expand Down Expand Up @@ -73,3 +73,11 @@ test_that("mlr3book authors don't sleepwalk through life", {
bmr = benchmark(benchmark_grid(tasks, learners, rsmp("cv", folds = 2)))

})

test_that("ppl - dictionary suggest works", {

# test that correct dictionary is checked against
expect_error(ppl("adas"), "po\\(\\): 'pca'")
expect_error(ppls("adas"), "pos\\(\\): 'pca'")

})

0 comments on commit 5099de7

Please sign in to comment.