Skip to content

Commit

Permalink
ParamLrner 100% test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
fouodo committed Jul 19, 2024
1 parent 8842ffa commit 3bd2ff9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 0 additions & 1 deletion .covrignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
./R/NewLayer.R
./R/NewMetaLayer.R
./R/NewStudy.R
./R/ParamLrner.R
./R/ParamVarSel.R
./R/predict.weightedMeanLearner.R
./R/PredictData.R
Expand Down
11 changes: 10 additions & 1 deletion tests/testthat/test-ParamLrner.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ ranger_param_lrner <- ParamLrner$new(id = "ParamRanger",
hyperparam_list = list(probability = TRUE,
mtry = 1L,
num.trees = 1000L))
test_that("ParamLrner instantiates correctly", {
test_that("ParamLrner: initialize and print", {
expect_true(R6::is.R6(ranger_param_lrner))
expect_equal(class(ranger_param_lrner)[1], "ParamLrner")
print(ranger_param_lrner)
})

test_that("ParamLrner: getParamLrner", {
expect_no_error(ranger_param_lrner$getParamLrner())
})

test_that("ParamLrner: getHyperparam", {
expect_no_error(ranger_param_lrner$getHyperparam())
})

0 comments on commit 3bd2ff9

Please sign in to comment.