Skip to content

Commit c67fab5

Browse files
committed
Add a test that reproduce the captions error
1 parent 10c1350 commit c67fab5

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Pandoc = function(doc)
2+
internal_error()
3+
end
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
format: latex
3+
filters:
4+
- error.lua
5+
---
6+
7+
content

tests/testthat/test-render.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,27 @@ test_that("quarto_render allows to pass output-file meta", {
124124
expect_true(file.exists("final_report.html"))
125125
expect_true(file.exists("final_report.docx"))
126126
})
127+
128+
129+
test_that("{ } are escaped correctly in abort message", {
130+
skip_if_no_quarto()
131+
proj <- test_path("resources", "cli_error")
132+
withr::local_dir(proj)
133+
keep_files <- list.files(".", all.files = TRUE)
134+
withr::defer({
135+
unlink(
136+
setdiff(list.files(".", all.files = TRUE), keep_files),
137+
recursive = TRUE,
138+
force = TRUE
139+
)
140+
})
141+
withr::local_options(quarto.tests.hide_echo = TRUE)
142+
expect_snapshot(
143+
error = TRUE,
144+
quarto_render(
145+
"pdf-error.qmd",
146+
quiet = FALSE,
147+
quarto_args = c("--log", "test.log")
148+
)
149+
)
150+
})

0 commit comments

Comments
 (0)