(v1.3.0.9027) unit tests

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2020-09-24 00:50:23 +02:00
1 parent c19095a3d5
commit 027215ed94
17 files changed
+23 -20

No files matched your search

+1 -1
View File
@@ -43,7 +43,7 @@ test_that("ab_property works", {
expect_identical(ab_ddd("AMX", "oral"), 1.5)
expect_identical(ab_ddd("AMX", "oral", units = TRUE), "g")
expect_identical(ab_ddd("AMX", "iv"), 1)
expect_identical(ab_ddd("AMX", "iv"), 3)
expect_identical(ab_ddd("AMX", "iv", units = TRUE), "g")
expect_identical(ab_name(x = c("AMC", "PLB"), language = NULL), c("Amoxicillin/clavulanic acid", "Polymyxin B"))
+1 -1
View File
@@ -29,7 +29,7 @@ test_that("counts work", {
expect_equal(count_all(example_isolates$AMX), n_rsi(example_isolates$AMX))
# AMX resistance in `example_isolates`
expect_equal(count_R(example_isolates$AMX), 683)
expect_equal(count_R(example_isolates$AMX), 804)
expect_equal(count_I(example_isolates$AMX), 3)
expect_equal(suppressWarnings(count_S(example_isolates$AMX)), 543)
expect_equal(count_R(example_isolates$AMX) + count_I(example_isolates$AMX),
+1 -1
View File
@@ -74,7 +74,7 @@ test_that("first isolates work", {
type = "points",
info = TRUE),
na.rm = TRUE)),
1400)
1399)
# first non-ICU isolates
expect_equal(
+2 -2
View File
@@ -29,8 +29,8 @@ test_that("proportions works", {
expect_equal(proportion_SI(example_isolates$AMX), susceptibility(example_isolates$AMX))
# AMX resistance in `example_isolates`
expect_equal(proportion_R(example_isolates$AMX), 0.5557364, tolerance = 0.0001)
expect_equal(proportion_I(example_isolates$AMX), 0.002441009, tolerance = 0.0001)
expect_equal(proportion_R(example_isolates$AMX), 0.5955556, tolerance = 0.0001)
expect_equal(proportion_I(example_isolates$AMX), 0.002222222, tolerance = 0.0001)
expect_equal(1 - proportion_R(example_isolates$AMX) - proportion_I(example_isolates$AMX),
proportion_S(example_isolates$AMX))
expect_equal(proportion_R(example_isolates$AMX) + proportion_I(example_isolates$AMX),