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:
@ -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"))
|
||||
})
|
||||
|
@ -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"))
|
||||
})
|
||||
|
Reference in New Issue
Block a user