tests/testthat/stringr-imported/test-equal.R

test_that("vectorised using TRR", {
  expect_equal(str_equal("a", character()), logical())
  expect_equal(str_equal("a", "b"), FALSE)
  expect_equal(str_equal("a", c("a", "b")), c(TRUE, FALSE))
  expect_snapshot(cran = TRUE, str_equal(letters[1:3], c("a", "b")), error = TRUE)
})

test_that("can ignore case", {
  expect_equal(str_equal("a", "A"), FALSE)
  expect_equal(str_equal("a", "A", ignore_case = TRUE), TRUE)
})

Try the charr package in your browser

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

charr documentation built on Nov. 7, 2026, 9:06 a.m.