Skip to content

Commit

Permalink
Avoid warnings in test
Browse files Browse the repository at this point in the history
  • Loading branch information
hughjonesd committed Feb 16, 2024
1 parent f524b51 commit fad217e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
Binary file modified tests/testthat/bar-rmd_files/figure-latex/unnamed-chunk-2-1.pdf
Binary file not shown.
Binary file modified tests/testthat/figure/unnamed-chunk-3-1.pdf
Binary file not shown.
Binary file modified tests/testthat/foo-rmd_files/figure-latex/unnamed-chunk-2-1.pdf
Binary file not shown.
Binary file removed tests/testthat/foo.synctex.gz
Binary file not shown.
9 changes: 7 additions & 2 deletions tests/testthat/test_basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ test_that("Can compile when in different directory", {
file.copy(files[idx], tmpdir[idx])
paths[idx] <- file.path(tmpdir[idx], files[idx])
}
latexdiff(paths[1], paths[2], open = FALSE)
expect_warning(
latexdiff(paths[1], paths[2], open = FALSE)
)
check_and_remove("diff.pdf")
})

Expand Down Expand Up @@ -95,7 +97,10 @@ test_that("Gives error when diff.pdf is old", {

skip_if_not(file.exists("diff.pdf"), message = "diff.pdf didn't get created")

expect_error(latexdiff(file1, "wont-compile.tex"), "Failed to create")
# warnings are fine but not required
suppressWarnings(
expect_error(latexdiff(file1, "wont-compile.tex"), "Failed to create")
)
if (file.exists("diff.pdf")) file.remove("diff.pdf")
})

Expand Down

0 comments on commit fad217e

Please sign in to comment.