Skip to content

Commit 984b695

Browse files
Fix checking for chunks to ignore in .Rnw files (#438)
1 parent a89923b commit 984b695

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ omit_pre_post <- function(x, pre = 0, post = 0) {
515515
substr(x, 1L + pre, nchar(x) - post)
516516
}
517517

518-
thruthy_strings <- c("true", "t", "1", "on", "yes", "on")
518+
truthy_strings <- c("true", "t", "1", "on", "yes")
519519

520520
is_truthy <- function(x) {
521521
(is.logical(x) && length(x) >= 1 && !is.na(x[[1]]) && x[[1]]) ||

tests/testthat/fixtures/scan/ignore-test.Rnw

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,16 @@ library(good)
6464
library(good)
6565
@
6666

67+
<<chunk1, renv.ignore = "t">>=
68+
library(notthis)
69+
@
70+
71+
<<chunk1, eval = "off">>=
72+
library(notthis)
73+
@
74+
75+
<<chunk1, exercise = "yes">>=
76+
library(notthis)
77+
@
78+
6779
\end{document}

0 commit comments

Comments
 (0)