From 80d41c7ddae3b741b0e3db20375db99e376de537 Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Thu, 27 Jun 2024 15:16:56 +0100 Subject: [PATCH] add tests for utility functions --- tests/testthat/test-utils.R | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 5d640c0..0127d63 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -11,6 +11,37 @@ testthat::test_that( ) ) +testthat::test_that( + "get_age_values warns appropriately", + testthat::expect_warning( + get_age_values(age[5], age_type[5]) + ) +) + +testthat::test_that( + "get_age_values warns appropriately", + testthat::expect_warning( + get_age_values(age[3], age_type[3]) + ) +) + +testthat::test_that( + "get_age_values warns appropriately", + testthat::expect_warning( + get_age_values(age[2], age_type[2]) + ) +) + +testthat::test_that( + "get_score_combo outputs appropriate results", + testthat::expect_s3_class( + get_score_combo( + scores = c(1, 2, 3, 4, 5), + labels = c("A", "B", "C", "D", "E") + ), + "tbl" + ) +) testthat::test_that( "list_ill_defined_icd11 outputs appropriate results",