mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-19 13:17:30 +02:00
three new functions and new version
This commit is contained in:
parent
ee396fb811
commit
8bd4d9ade7
11 changed files with 415 additions and 49 deletions
20
tests/testthat/test-utils.R
Normal file
20
tests/testthat/test-utils.R
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
test_that("strsplitx works", {
|
||||
expect_equal(2 * 2, 4)
|
||||
test <- c("12 months follow-up", "3 steps", "mRS 6 weeks", "Counting to 231 now")
|
||||
expect_length(strsplitx(test,"[0-9]",type="around")[[1]],3)
|
||||
|
||||
expect_equal(strsplitx(test,"[0-9]",type="classic")[[2]][1],"")
|
||||
expect_length(strsplitx(test,"[0-9]",type="classic")[[4]],4)
|
||||
|
||||
expect_length(strsplitx(test,"[0-9]",type="classic")[[4]],4)
|
||||
})
|
||||
|
||||
test_that("d2w works", {
|
||||
|
||||
expect_length(d2w(c(2:8,21)),8)
|
||||
|
||||
expect_equal(d2w(data.frame(2:7,3:8,1),lang="da",
|
||||
neutrum=TRUE)[1,3],"et")
|
||||
|
||||
expect_equal(d2w(list(2:8,c(2,6,4,23),2), everything=T)[[2]][4],"two three")
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue