From 2a7e5e7d3512633449923bf250c875822a03491a Mon Sep 17 00:00:00 2001 From: Michael Schubert Date: Mon, 13 Jan 2025 14:26:45 +0100 Subject: [PATCH] add test case for #337 --- tests/testthat/test-0-util.r | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/testthat/test-0-util.r b/tests/testthat/test-0-util.r index 7d7b05e..deea188 100644 --- a/tests/testthat/test-0-util.r +++ b/tests/testthat/test-0-util.r @@ -48,3 +48,13 @@ test_that("no sci format when passing vectors", { expect_equal(fill_template(tmpl, values), "1 and 1000000") }) + +test_that("BiocGenerics changes format dispatch (#337)", { + # see: https://github.com/Bioconductor/BiocGenerics/blob/RELEASE_3_20/R/format.R + setGeneric("format") + format.list = base::format.AsIs + + tmpl = "{{ var1 }} and {{ var2 }}" + values = c(var1=1, var2=100) + expect_equal(fill_template(tmpl, values), "1 and 100") +})