Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure verify_output() handles \r correctly #1048

Closed
hadley opened this issue Jun 16, 2020 · 1 comment · Fixed by #1055
Closed

Ensure verify_output() handles \r correctly #1048

hadley opened this issue Jun 16, 2020 · 1 comment · Fixed by #1055
Labels
bug an unexpected problem or unintended behavior snapshot 📷

Comments

@hadley
Copy link
Member

hadley commented Jun 16, 2020

library(testthat)

path <- tempfile()  
verify_output(path, cat("\r\n"))
#> Warning: Creating reference output
verify_output(path, cat("\r\n"))
#> Error: Results have changed from known value recorded in '/tmp/RtmpKf8dbf/file5e0b64a0acc5'.
#> 1/3 mismatches
#> x[2]: "\r"
#> y[2]: ""

Created on 2020-06-16 by the reprex package (v0.3.0)

@hadley hadley added bug an unexpected problem or unintended behavior snapshot 📷 labels Jun 16, 2020
@hadley
Copy link
Member Author

hadley commented Jun 17, 2020

test_that("verify_output() handles line-feeds", {
  verify_output(test_path("test-verify-conditions-lf.txt"), {
    cat("\r\n")
  })
})

hadley added a commit that referenced this issue Jun 23, 2020
hadley added a commit that referenced this issue Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior snapshot 📷
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant