File: test-helpers-where.R

package info (click to toggle)
r-cran-tidyselect 1.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 556 kB
  • sloc: sh: 13; makefile: 2
file content (9 lines) | stat: -rw-r--r-- 324 bytes parent folder | download
1
2
3
4
5
6
7
8
9

test_that("where() selects with a predicate", {
  expect_identical(select_loc(iris, where(is.factor)), c(Species = 5L))
  expect_identical(select_loc(iris, where(~ is.factor(.x))), c(Species = 5L))
})

test_that("where() checks return values", {
  expect_error(select_loc(iris, where(~ NA)), "return `TRUE` or `FALSE`")
})