We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Suppose a test file has the contents:
skip("I don't want to run these") test_that("multiplication works", { expect_equal(2 * 2, 4) })
devtools::test() gives:
devtools::test()
ℹ Testing example.test Starting 1 test process ✔ | F W S OK | Context ⠼ [ FAIL 0 | WARN 0 | SKIP 0 | PASS 0 ] Starting up... Error in self$snaps[[variant]][[test]] : attempt to select less than one element in get1index
This occurs within here:
testthat/R/snapshot-file-snaps.R
Lines 49 to 61 in dbe8883
because test is not set, and so is just an empty character vector. It looks like we are checking for NULL here:
test
NULL
https://github.com/r-lib/testthat/blob/main/R/snapshot-reporter.R#L119-L121
but this change coerces NULL to character(0):
character(0)
dd39c65
so that change probably needs to be updated to handle any kind zero-length vector.
The text was updated successfully, but these errors were encountered:
Hmmmm, might be better to instead fix the gsub() to only occur if test is a string?
gsub()
Sorry, something went wrong.
24ff6c0
Successfully merging a pull request may close this issue.
Suppose a test file has the contents:
devtools::test()
gives:This occurs within here:
testthat/R/snapshot-file-snaps.R
Lines 49 to 61 in dbe8883
because
test
is not set, and so is just an empty character vector. It looks like we are checking forNULL
here:https://github.com/r-lib/testthat/blob/main/R/snapshot-reporter.R#L119-L121
but this change coerces
NULL
tocharacter(0)
:dd39c65
so that change probably needs to be updated to handle any kind zero-length vector.
The text was updated successfully, but these errors were encountered: