tests/testthat/test-check_id.R

# Generated by fusen: do not edit by hand

test_that("check_id works", {
  t_ <- tibble::tibble
  expect_type(check_id(t_(id = 1), t_(id = 1)), type = "list")
  expect_error(check_id(t_(ids = 1), t_(id = 1)))
  expect_error(check_id(t_(id = 1), t_(ids = 1)))
  expect_error(check_id(t_(ids = 1), t_(ids = 1)))
  
  expect_type(check_id(t_(id = 1:2), t_(id = 1:2)), type = "list")
  expect_error(check_id(t_(id = c(1,2)), t_(id = c(1,1))))
  expect_error(check_id(t_(id = c(1,1)), t_(id = c(1,2))))
  expect_error(check_id(t_(id = c(1,1)), t_(id = c(1,1))))
  
})
MatthiasUckert/Rmatch documentation built on Jan. 3, 2022, 11:09 p.m.