Skip to content

Complex skip condition may fail vapply in reporter #791

@HughParsonage

Description

@HughParsonage

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorskip

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions