Skip to content

Commit

Permalink
tests on data.tables
Browse files Browse the repository at this point in the history
  • Loading branch information
philipdelff committed Jan 17, 2025
1 parent c1664d9 commit 3d186f5
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 3 deletions.
9 changes: 8 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
`$DATA` and `$INPUT` sections based on a data set. Previously a data
object had to be passed to the function. Now also just a path to the
data set on file can be used.


* `fnAppend()` can now append to strings that do not have a file name
extension. `fnAppend()` is mainly intended for editing file names
with file name extensions but for programming purposes, this
generalization is useful.


## Bugfixes
* `NMreadExt()` was incorrectly calculating blocksize for some
Expand Down Expand Up @@ -58,6 +63,8 @@
* `NMgenText()` now looks up `col.flagn` using `NMdataConf()` for
default value.

* `NMwriteData()` can now control stamping using `args.stamp` even if
no `script` is provided.

# NMdata 0.1.8

Expand Down
Binary file removed tests/testthat/testReference/NMreadInits_01.rds
Binary file not shown.
Binary file removed tests/testthat/testReference/NMreadInits_02.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadInits_02_elems.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadInits_02_lines.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadInits_02_pars.rds
Binary file not shown.
Binary file removed tests/testthat/testReference/NMreadInits_03.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadInits_03_elems.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadInits_03_lines.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadInits_03_pars.rds
Binary file not shown.
9 changes: 7 additions & 2 deletions tests/testthat/test_NMreadInits.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ test_that("basic",{

res1$lines[grepl("^ +$",text.before),text.before:=""]

## cat(paste(res1$lines$text.before,collapse=":"),"\n")
## cat(paste(readRDS(fileRef)$lines$text.before,collapse=":"),"\n")
## cat(paste(res1$lines$text.before,collapse=":"),"\n")
## cat(paste(readRDS(fileRef)$lines$text.before,collapse=":"),"\n")

## expect_equal_to_reference(res1,fileRef)
expect_equal_to_reference(res1$pars,fnAppend(fileRef,"pars"))
Expand All @@ -26,12 +26,15 @@ test_that("basic",{

test_that("with OMEGA block",{
NMdataConf(reset=T)
NMdataConf(as.fun="data.table")

fileRef <- "testReference/NMreadInits_02.rds"

file.mod <- "testData/nonmem/xgxr133.mod"
res1 <- NMreadInits(file=file.mod,return="all")

res1$lines[grepl("^ +$",text.before),text.before:=""]

## expect_equal_to_reference(res1,fileRef)
expect_equal_to_reference(res1$pars,fnAppend(fileRef,"pars"))
expect_equal_to_reference(res1$elements,fnAppend(fileRef,"elems"))
Expand All @@ -41,6 +44,8 @@ test_that("with OMEGA block",{

test_that("OMEGA SAME",{
NMdataConf(reset=T)
NMdataConf(as.fun="data.table")

fileRef <- "testReference/NMreadInits_03.rds"

text <- c("
Expand Down

0 comments on commit 3d186f5

Please sign in to comment.