Skip to content

Commit 68bc43e

Browse files
committed
Improve layout of log file
1 parent d47546a commit 68bc43e

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

R/utils.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,14 @@ svg_files_lines <- function(case, pkg_path = NULL) {
9797

9898
chr_lines(
9999
glue(
100-
">>> Failed doppelganger: { case$name } <<<
101-
>>> Original SVG:"
100+
">> Failed doppelganger: { case$name }
101+
> Original SVG:"
102102
),
103103
readLines(original_path),
104-
">>> Testcase SVG:",
104+
"",
105+
"> Testcase SVG:",
105106
readLines(case$testcase),
106-
"<<<"
107+
""
107108
)
108109
}
109110
from_test_dir <- function(pkg_path, path) {

tests/testthat/test-expectations.R

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,3 @@ test_that("Doppelgangers pass", {
2424
expect_is(ggplot_result, "expectation_success")
2525
expect_is(base_result, "expectation_success")
2626
})
27-
28-
test_that("Verbose outputs svg files", {
29-
output <- mock_cases_outputs$output
30-
expect_true(grepl(">>> Failed doppelganger: myplot", output))
31-
})

tests/testthat/test-mismatch.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ test_that("failures are pushed to log file", {
77

88
log <- readLines(file.path(mock_pkg_dir, "tests", "vdiffr.fail"))
99

10-
n_logged <- length(grep(">>> Failed doppelganger:", log))
10+
n_logged <- length(grep(">> Failed doppelganger:", log))
1111
n_failures <- length(keep(mock_cases, inherits, "mismatch_case"))
1212
expect_identical(n_logged, n_failures)
1313
})
14+
15+
test_that("Verbose outputs svg files", {
16+
output <- mock_cases_outputs$output
17+
expect_true(grepl(">> Failed doppelganger: myplot", output))
18+
})

0 commit comments

Comments
 (0)