From 6e5ea878700d040cd5338e1540b73ebf53d2c1b7 Mon Sep 17 00:00:00 2001 From: benoit Date: Fri, 6 Oct 2023 10:05:39 +0200 Subject: [PATCH 1/2] add patient labels --- R/zzz.R | 5 ++++- tests/testthat/test-render_safe.R | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/R/zzz.R b/R/zzz.R index 8d09c09b..ee3ff626 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,7 +1,10 @@ whisker_env <- NULL .onLoad <- function(libname, pkgname) { - default_whiskers <- c(patient_label = "patients") + default_whiskers <- c( + patients_label = "patients", + patient_label = "patient" + ) whisker_env <<- new.env(parent = globalenv()) add_whisker(default_whiskers) } diff --git a/tests/testthat/test-render_safe.R b/tests/testthat/test-render_safe.R index 076e5add..e92519ee 100644 --- a/tests/testthat/test-render_safe.R +++ b/tests/testthat/test-render_safe.R @@ -22,8 +22,8 @@ test_that("add_whisker and remove_whisker works", { # render_safe ---- test_that("render_safe works", { - expect_identical(render_safe("patient label is {Patient_label}"), "patient label is Patients") - expect_identical(render_safe("patient label is {patient_label}"), "patient label is patients") - expect_identical(render_safe("patient label is {PATIENT_LABEL}"), "patient label is PATIENTS") + expect_identical(render_safe("patient label is {Patients_label}"), "patient label is Patients") + expect_identical(render_safe("patient label is {patients_label}"), "patient label is patients") + expect_identical(render_safe("patient label is {PATIENTS_LABEL}"), "patient label is PATIENTS") expect_identical(render_safe("patient label is {misspell}"), "patient label is misspell") }) From a543fc9d466447f8587bf3c784930869f763c3f7 Mon Sep 17 00:00:00 2001 From: benoit Date: Mon, 9 Oct 2023 14:22:00 +0200 Subject: [PATCH 2/2] update NEWS --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 870d97ce..744187e0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # dunlin 0.1.5.9000 +* The whisker placeholder `{patient_label}` is now replaced by default by `"patient"` while `{patients_label}` correspond to `"patients"`. + # dunlin 0.1.5 * `empty_rule` is removed now. `rule()` will create a normal `rule` object.