Skip to content

Commit

Permalink
tests: add unit test for is_volatile_anesthesia
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibb committed Jun 9, 2024
1 parent f09dd94 commit a507998
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/testthat/test_read_logbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@ test_that("case_end", {
expect_in(case_end(lb), c(3, 5))
})

test_that("is_volatile_anesthesia", {
lb <- data.table(
Label = c(
"prim. Agent exp", "Vaporizer setting",
"prim. Agent exp",
"prim. Agent exp", "Vaporizer setting",
"prim. Agent exp", "Vaporizer setting"
),
Current = c(
0, 0,
1.2,
1.2, 8,
0, 8
),
CaseId = c(
1, 1,
2,
3, 3,
4, 4
)
)
expect_equal(is_volatile_anesthesia(lb), c(FALSE, FALSE, TRUE, FALSE))
})

test_that(".add_anaesthesia_case_id", {
lb <- data.table(
DateTime = 1:6,
Expand Down

0 comments on commit a507998

Please sign in to comment.