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

(v0.7.1.9062) mo/ab assignment improvements

This commit is contained in:
2019-08-26 16:02:03 +02:00
parent 13d4fef801
commit 7a6fce4eb8
19 changed files with 383 additions and 378 deletions

View File

@ -54,5 +54,12 @@ test_that("as.ab works", {
expect_equal(suppressWarnings(as.character(as.ab(c("Bacteria", "Bacterial")))),
c(NA, "TMP"))
# assigning and subsetting
x <- antibiotics$ab
expect_s3_class(x[1], "ab")
expect_s3_class(x[[1]], "ab")
expect_s3_class(c(x[1], x[9]), "ab")
expect_warning(x[1] <- "invalid code")
expect_warning(x[[1]] <- "invalid code")
expect_warning(c(x[1], "test"))
})

View File

@ -284,4 +284,13 @@ test_that("as.mo works", {
# print tibble
expect_output(print(tibble(mo = as.mo("B_STRPT_PNE"))))
# assigning and subsetting
x <- septic_patients$mo
expect_s3_class(x[1], "mo")
expect_s3_class(x[[1]], "mo")
expect_s3_class(c(x[1], x[9]), "mo")
expect_warning(x[1] <- "invalid code")
expect_warning(x[[1]] <- "invalid code")
expect_warning(c(x[1], "test"))
})