From 71f64110f2d84ef6a48147b03729596c41d6930d Mon Sep 17 00:00:00 2001 From: Luke Symes Date: Fri, 7 Feb 2025 12:13:45 +1300 Subject: [PATCH] Fix checking for chunks to ignore in .Rnw files --- R/utils.R | 2 +- tests/testthat/fixtures/scan/ignore-test.Rnw | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 3329c10b..9785ff1e 100644 --- a/R/utils.R +++ b/R/utils.R @@ -515,7 +515,7 @@ omit_pre_post <- function(x, pre = 0, post = 0) { substr(x, 1L + pre, nchar(x) - post) } -thruthy_strings <- c("true", "t", "1", "on", "yes", "on") +truthy_strings <- c("true", "t", "1", "on", "yes") is_truthy <- function(x) { (is.logical(x) && length(x) >= 1 && !is.na(x[[1]]) && x[[1]]) || diff --git a/tests/testthat/fixtures/scan/ignore-test.Rnw b/tests/testthat/fixtures/scan/ignore-test.Rnw index 16d959c3..53479948 100644 --- a/tests/testthat/fixtures/scan/ignore-test.Rnw +++ b/tests/testthat/fixtures/scan/ignore-test.Rnw @@ -64,4 +64,16 @@ library(good) library(good) @ +<>= +library(notthis) +@ + +<>= +library(notthis) +@ + +<>= +library(notthis) +@ + \end{document}