Skip to content

Commit 0135378

Browse files
committed
Update nonmem reader test to reflect new defaults
1 parent c8396bb commit 0135378

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

tests/testthat/test-nonmem_reader.R

+30-6
Original file line numberDiff line numberDiff line change
@@ -7,86 +7,109 @@ test_that("read_extfile: params: npde, iwres, ipred;
77
file = "run001.ext",
88
path = file.path(system.file(package = "ggPMX"), "testdata", "extdata", "run001.ext"),
99
read_fun = "data.table",
10-
quiet = F
10+
quiet = FALSE
1111
)
12+
1213
expect_true(inherits(r, "list"))
14+
1315
})
1416

1517
test_that("read_extfile: params: project, path is NULL, file doesn't exist;
1618
result: error", {
19+
1720
expect_error(read_extfile(
1821
run = "run001",
1922
project = file.path(system.file(package = "ggPMX"), "testdata", "extdata"),
2023
path = NULL,
2124
read_fun = "data.table",
22-
quiet = F
25+
quiet = FALSE
2326
))
27+
2428
})
2529

2630
test_that("read_extfile: params: project is NULL, read_fun is read.table;
2731
result: error", {
32+
2833
expect_error(read_extfile(
2934
project = NULL,
3035
file = "run001.ext",
3136
path = file.path(system.file(package = "ggPMX"), "testdata", "extdata", "run001.grd"),
3237
read_fun = "read.table",
33-
quiet = F
38+
quiet = FALSES
3439
))
40+
3541
})
3642

3743
test_that("pmx_nm: params: npde, iwres, ipred;
3844
result: can read NONMEM-Output", {
45+
3946
ctr <- pmx_nm(
4047
directory = file.path(system.file(package = "ggPMX"), "testdata", "extdata"),
4148
npde = "TAD", iwres = "IWRES", ipred = "IPRED", runno = "001"
4249
)
4350
expect_true(inherits(ctr, "pmxClass"))
51+
4452
})
4553

4654
test_that("pmx_nm: params: runno is NULL, file is run001.coi;
4755
result: error", {
56+
4857
nonmem_dir <- file.path(system.file(package = "ggPMX"), "testdata", "extdata")
4958
expect_error(pmx_nm(directory = nonmem_dir, runno = NULL, file = "run001.coi"))
59+
5060
})
5161

5262
test_that("pmx_nm: params: simfile;
5363
result: can read NONMEM-Output", {
64+
5465
nonmem_dir <- file.path(system.file(package = "ggPMX"), "testdata", "extdata")
5566
ctr <- pmx_nm(directory = nonmem_dir, runno = "001", simfile = "custom_sim.lst")
5667
expect_true(inherits(ctr, "pmxClass"))
68+
5769
})
5870

5971
test_that("pmx_nm: params: obs is T;
6072
result: warning", {
73+
6174
nonmem_dir <- file.path(system.file(package = "ggPMX"), "testdata", "extdata")
62-
expect_warning(pmx_nm(directory = nonmem_dir, runno = "001", obs = T))
75+
expect_warning(pmx_nm(directory = nonmem_dir, runno = "001", obs = TRUE))
76+
6377
})
6478

6579
test_that("pmx_nm: params: Endpoint value does not correspond to dvid values;
6680
result: warning", {
81+
6782
nonmem_dir <- file.path(system.file(package = "ggPMX"), "testdata", "extdata")
6883
expect_warning(pmx_nm(directory = nonmem_dir, runno = "001", endpoint = 12))
84+
6985
})
7086

7187
test_that("pmx_nm: params: Endpoint value corresponds to dvid values;
7288
result: error", {
89+
7390
nonmem_dir <- file.path(system.file(package = "ggPMX"), "testdata", "extdata")
7491
expect_error(pmx_nm(directory = nonmem_dir, runno = "001", endpoint = 2.75, dvid = "TAD"))
92+
7593
})
7694

7795
test_that("pmx_nm: params: settings is not pmxSettingsClass object;
7896
result: can read NONMEM-Output", {
97+
7998
nonmem_dir <- file.path(system.file(package = "ggPMX"), "testdata", "extdata")
8099
ctr <- pmx_nm(directory = nonmem_dir, runno = "001", settings = list(use.titles = TRUE))
100+
81101
})
82102

83103
test_that("pmx_nm: params: file is NULL, runno is NULL;
84104
result: error", {
85-
expect_error(pmx_nm(file = NULL, runno = NULL))
105+
106+
expect_error(pmx_nm(file = NULL, runno = NULL))
107+
86108
})
87109

88110
test_that("pmx_nm: params: directory, file, simfile;
89111
result: can read NONMEM-Output", {
112+
90113
nonmem_dir <- file.path(system.file(package = "ggPMX"), "testdata", "extdata")
91114
ctr <- pmx_nm(directory = nonmem_dir, runno = "001")
92115
# just to test alternative loadings
@@ -164,7 +187,7 @@ test_that("pmx_nm: params: directory, file, simfile;
164187
structure(
165188
list(
166189
is.draft = TRUE, use.abbrev = TRUE, color.scales = NULL, use.labels = FALSE,
167-
cats.labels = NULL, use.titles = TRUE, effects = NULL
190+
cats.labels = NULL, use.titles = FALSE, effects = NULL
168191
),
169192
class = c("pmxSettingsClass")
170193
)
@@ -188,4 +211,5 @@ test_that("pmx_nm: params: directory, file, simfile;
188211
expect_identical(
189212
names(ctr_man$input), names(ctr_man_norunno$input)
190213
)
214+
191215
})

0 commit comments

Comments
 (0)