Skip to content

Commit

Permalink
tests: adapt to pmeld_plus7 and add tests for pmeld
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibb committed Mar 11, 2022
1 parent b06219b commit 0570b80
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/testthat/test_meld.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,17 @@ test_that("meld_na", {
)
})

test_that("meld_plus7", {
test_that("pmeld", {
expect_equal(pmeld(20), 0.9237, tolerance = 1e-4)
expect_equal(
meld_plus7(
pmeld(creatinine = 1.9, bilirubin = 4.2, inr = 1.2, cause = "other"),
0.9232, tolerance = 1e-4
)
})

test_that("pmeld_plus7", {
expect_equal(
pmeld_plus7(
creatinine = 1.37, bilirubin = 2.49, inr = 1.5, sodium = 136.5,
albumin = 2.89, wbc = 6.67, age = 60, round = TRUE
), 0.16
Expand Down

0 comments on commit 0570b80

Please sign in to comment.