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

Complex skip condition may fail vapply in reporter #791

Closed
HughParsonage opened this issue Aug 16, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@HughParsonage
Copy link

commented Aug 16, 2018

When skip_if_not is given a sufficiently complex condition (that is FALSE) the standard reporter gives an error at.

summary <- vapply(issues, issue_summary, FUN.VALUE = character(1))

test_reprex.R

context("reprex")

test_that("reprex ", {
  AND <- `&&`
  OR <- `||`
  
  skip_if_not(OR(FALSE,
                 AND(identical(Sys.getenv("TRAVIS"), "dsf"),
                     Sys.getenv("TRAVIS_PULL_REQUEST") != "true")))
  expect_true(TRUE)
})
> devtools::test(filter = "reprex")
√ | OK F W S | Context
√ |  0     1 | reprex
--------------------------------------------------------------------------------
Error in vapply(issues, issue_summary, FUN.VALUE = character(1)) : 
  values must be length 1,
 but FUN(X[[1]]) result is length 2

== Results =====================================================================
OK:       0
Failed:   0
Warnings: 0
Skipped:  1

Woot!

@hadley hadley added bug skip labels Mar 28, 2019

@hadley hadley added this to the testthat 2.1.0 milestone Apr 1, 2019

@hadley hadley closed this in b0b073d Apr 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.