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

few extra tests

This commit is contained in:
2018-08-24 14:18:38 +02:00
parent a100d07da6
commit baaf4cc3e1
4 changed files with 16 additions and 7 deletions

View File

@ -51,6 +51,7 @@ test_that("frequency table works", {
expect_output(septic_patients %>% select(1:7) %>% freq() %>% print())
expect_output(septic_patients %>% select(1:8) %>% freq() %>% print())
expect_output(septic_patients %>% select(1:9) %>% freq() %>% print())
expect_output(print(freq(septic_patients$age), nmax = 20))
# top 5
expect_equal(

View File

@ -23,9 +23,18 @@ test_that("joins work", {
expect_true(nrow(unjoined) < nrow(right))
expect_true(nrow(unjoined) < nrow(full))
expect_equal(nrow(inner_join_microorganisms("ESCCOL")), 1)
expect_equal(nrow(inner_join_microorganisms("ESCCOL", by = c("bactid" = "bactid"))), 1)
expect_warning(inner_join_microorganisms("Escherichia", by = c("bactid" = "genus")))
expect_equal(nrow(left_join_microorganisms("ESCCOL")), 1)
expect_warning(left_join_microorganisms("Escherichia", by = c("bactid" = "genus")))
expect_equal(nrow(semi_join_microorganisms("ESCCOL")), 1)
expect_equal(nrow(anti_join_microorganisms("ESCCOL")), 0)
eexpect_warning(right_join_microorganisms("ESCCOL"))
eexpect_warning(full_join_microorganisms("ESCCOL"))
})