Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philipdelff committed Oct 31, 2024
1 parent 7a2394e commit 5d5df55
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions R/cleanSpaces.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
##' is TRUE.
##' @param trail Drop spaces after last non-empty character. Default
##' is TRUE.
##' @return A vector of class character
##' @keywords internal
##'
cleanSpaces <- function(x,double=TRUE,lead=TRUE,trail=TRUE){
Expand Down
3 changes: 3 additions & 0 deletions man/cleanSpaces.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added tests/testthat/testReference/NMdataConf_03.rds
Binary file not shown.
Binary file added tests/testthat/testReference/dt2mat_1.rds
Binary file not shown.
Binary file added tests/testthat/testReference/mat2dt_1.rds
Binary file not shown.
20 changes: 20 additions & 0 deletions tests/testthat/test_dt2mat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

context("dt2mat")

test_that("basic",{
fileRef <- "testReference/dt2mat_1.rds"

ext <- NMreadExt("testData/nonmem/xgxr021.mod",as.fun="data.table")

omegas <- ext[par.type=="OMEGA"]

res <- dt2mat(omegas)

omegas[i==j,.(i,j,value)]
omegas[i!=j,.(i,j,value)]
res

expect_equal_to_reference(res,fileRef)

})

14 changes: 14 additions & 0 deletions tests/testthat/test_mat2dt.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

context("mat2dt")

test_that("basic",{
fileRef <- "testReference/mat2dt_1.rds"

cov <- NMreadCov("testData/nonmem/xgxr032.cov")

res <- mat2dt(cov)


expect_equal_to_reference(res,fileRef)

})
Binary file modified vignettes/derived/pkdata.rds
Binary file not shown.
2 changes: 1 addition & 1 deletion vignettes/derived/pkdata_meta.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"parameter","value"
"DataCreateScript","NMdata-cheat.Rmd"
"CreationTime","2024-10-30 16:27:39 EDT"
"CreationTime","2024-10-30 22:22:21 EDT"
"writtenTo","derived/pkdata.rds derived/pkdata.csv"
"Description","PK data for the NMdata Cheatsheet"

0 comments on commit 5d5df55

Please sign in to comment.