tests/testthat/test-intersection.R

context("intersection")

test_that("check_intersection", {
  x1 <- 1:3
  x2 <- 1:4
  expect_identical(check_intersection(x1, x2), x1)
  expect_error(check_intersection(x1, x2, all_y = TRUE), "x1 must include all the elements in x2")
  expect_error(check_intersection(x2, x1), "x1 must include all the elements in x2")
})

Try the checkr package in your browser

Any scripts or data that you put into this service are public.

checkr documentation built on May 1, 2019, 6:59 p.m.