Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/testthat/_snaps/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
Error in `f()`:
! 4

# line-endings fixed before comparison

Code
cat(x)
Output
a
b

# multiple outputs of same type are collapsed

Code
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-snapshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ test_that("empty lines are preserved", {
expect_snapshot(f(), error = TRUE)
})

test_that("line-endings fixed before comparison", {
x <- "a\n\rb"
expect_snapshot(cat(x))
})

test_that("multiple outputs of same type are collapsed", {
expect_snapshot({
x <- 1
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-verify-output.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,9 @@ test_that("verify_exec() doesn't leave tempfiles around", {

expect_equal(before, after)
})

test_that("verify_exec() strips CR", {
act <- verify_exec(quote(cat("\r\n")))
exp <- verify_exec(quote(cat("\n")))
expect_equal(act[-1], exp[-1])
})
Loading