From 8ab93b66881ef8467f815fd176531351589adc85 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Thu, 23 Aug 2018 01:01:50 +0200 Subject: [PATCH] unit tests --- DESCRIPTION | 2 +- NEWS.md | 2 +- tests/testthat/test-count.R | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b9823397..e270f2ab 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -52,7 +52,7 @@ Imports: xml2 (>= 1.0.0), knitr (>= 1.0.0), readr, - rlang, + rlang (>= 0.2.0), rvest (>= 0.3.2) Suggests: testthat (>= 1.0.2), diff --git a/NEWS.md b/NEWS.md index 7e5db04c..8bd44fb2 100755 --- a/NEWS.md +++ b/NEWS.md @@ -6,7 +6,7 @@ #### Changed * Added parameters `minimum` and `as_percent` to `portion_df` -* Support for quasiquotation in the functions series `count_*` and `portions_*`, and `n_rsi`. This allow to check for more than 2 vectors or columns. +* Support for quasiquotation in the functions series `count_*` and `portions_*`, and `n_rsi`. This allows to check for more than 2 vectors or columns. * `septic_patients %>% select(amox, cipr) %>% count_R()` * `septic_patients %>% portion_S(amcl)` * `septic_patients %>% portion_S(amcl, gent)` diff --git a/tests/testthat/test-count.R b/tests/testthat/test-count.R index 67d48a5c..92d39945 100644 --- a/tests/testthat/test-count.R +++ b/tests/testthat/test-count.R @@ -22,6 +22,9 @@ test_that("counts work", { pull(combination), c(192, 440, 184, 474)) + expect_equal(septic_patients %>% select(amox, cipr) %>% count_df(translate_ab = "official") %>% nrow(), + 6) + # warning for speed loss expect_warning(count_R(as.character(septic_patients$amcl))) expect_warning(count_I(as.character(septic_patients$amcl)))