Skip to content

Commit 2bec2b2

Browse files
Expanded glmSLMA smoke testing
1 parent 9649447 commit 2bec2b2

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tests/testthat/test-arg-ds.glmSLMA.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,16 @@ connect.studies.dataset.cnsim(list("LAB_TSC"))
1919
#
2020

2121
context("ds.glmSLMA::arg::test errors")
22-
test_that("glmSLMA_erros", {
23-
expect_error(ds.glmSLMA(), " Please provide a valid regression formula!", fixed=TRUE)
22+
test_that("glmSLMA_errors", {
23+
expect_error(ds.glmSLMA(), " Please provide a valid regression formula!", fixed=TRUE)
24+
25+
expect_error(ds.glmSLMA('D$LAB_TSC~D$LAB_TRIG', family="gaussian", newobj="gaussian.glmslma.obj"), "There are some DataSHIELD errors, list them with datashield.errors()", fixed=TRUE)
26+
res.errors<-datashield.errors()
27+
expect_length(res.errors, 3)
28+
expect_equal(res.errors[[1]], "Command 'glmSLMADS1(D$LAB_TSC ~ D$LAB_TRIG, \"gaussian\", NULL, NULL, NULL)' failed on 'sim1': Error while evaluating 'dsBase::glmSLMADS1(D$LAB_TSC~D$LAB_TRIG, \"gaussian\", NULL, NULL, NULL)' -> Error in model.frame.default(formula = formula2use, data = dataTable, : \n invalid type (NULL) for variable 'D$LAB_TRIG'\n", fixed=TRUE)
29+
expect_equal(res.errors[[2]], "Command 'glmSLMADS1(D$LAB_TSC ~ D$LAB_TRIG, \"gaussian\", NULL, NULL, NULL)' failed on 'sim2': Error while evaluating 'dsBase::glmSLMADS1(D$LAB_TSC~D$LAB_TRIG, \"gaussian\", NULL, NULL, NULL)' -> Error in model.frame.default(formula = formula2use, data = dataTable, : \n invalid type (NULL) for variable 'D$LAB_TRIG'\n", fixed=TRUE)
30+
expect_equal(res.errors[[3]], "Command 'glmSLMADS1(D$LAB_TSC ~ D$LAB_TRIG, \"gaussian\", NULL, NULL, NULL)' failed on 'sim3': Error while evaluating 'dsBase::glmSLMADS1(D$LAB_TSC~D$LAB_TRIG, \"gaussian\", NULL, NULL, NULL)' -> Error in model.frame.default(formula = formula2use, data = dataTable, : \n invalid type (NULL) for variable 'D$LAB_TRIG'\n", fixed=TRUE)
31+
2432
})
2533

2634
#

0 commit comments

Comments
 (0)