1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-18 11:33:18 +02:00

unit test read.4d, unselecting freq cols

This commit is contained in:
2018-11-19 13:00:22 +01:00
parent 83c7da85ab
commit a8132922af
7 changed files with 127 additions and 22 deletions

View File

@ -0,0 +1,30 @@
context("read.4d.R")
test_that("read 4D works", {
library(dplyr)
test1 <- data.frame(Patientnr = "ABC",
MV = "M",
Monsternr = "0123",
Afnamedat = "10-11-12",
Bepaling = "bk",
Afd. = "ABC",
Spec = "ABC",
Matbijz. = "ABC",
Mat = "ABC",
Mocode = "esccol",
PENI = "R",
stringsAsFactors = FALSE)
tf <- tempfile()
write.table(test1, file = tf, quote = F, sep = "\t")
x <- read.4D(tf, skip = 0)
unlink(tf)
expect_equal(ncol(x), 11)
expect_equal(class(x$date_received), "Date")
expect_equal(class(x$mo), "mo")
expect_equal(as.character(x$mo), "B_ESCHR_COL")
expect_equal(is.rsi(x$peni), TRUE)
})