(v1.7.1.9056) unit tests

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2021-11-29 11:55:18 +01:00
1 parent c8698347cb
commit 5375f75829
21 files changed
+42 -74

No files matched your search

+4
View File
@@ -35,6 +35,10 @@ test_df <- rbind(
expect_equal(get_episode(test_df$date, 365),
c(1, 1, 2, 2, 2, 3, 3, 4, 1, 2, 2, 2, 3))
expect_equal(get_episode(test_df$date[which(test_df$patient_id == "A")], 365),
c(1, 1, 2, 2, 2, 2, 3, 4))
expect_equal(get_episode(test_df$date[which(test_df$patient_id == "B")], 365),
c(1, 2, 2, 2, 3))
if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0")) {
expect_identical(test_df %>% group_by(patient_id) %>% mutate(f = is_new_episode(date, 365)) %>% pull(f),
+1 -1
View File
@@ -40,7 +40,7 @@ expect_identical(class(outcome), c("ordered", "factor"))
# example_isolates should have these finding using Dutch guidelines
expect_equal(as.double(table(outcome)),
c(1970, 24, 6)) # 1970 neg, 24 unconfirmed, 6 pos
c(1954, 24, 6)) # 1954 neg, 24 unconfirmed, 6 pos, rest is NA
expect_equal(brmo(example_isolates, info = FALSE),
mdro(example_isolates, guideline = "BRMO", info = FALSE))