tests/testthat/test-rx.R

library(testthat)

test_that("emoji_rx captures all emojis", {
  mini_q_emojis <- emoji::emojis$emoji[emoji::emojis$qualified == "minimally-qualified"]
  fully_q_emojis <- emoji::emojis$emoji[emoji::emojis$qualified == "fully-qualified"]
  component_emojis <- emoji::emojis$emoji[emoji::emojis$qualified == "component"]
  unqualified_emojis <- emoji::emojis$emoji[emoji::emojis$qualified == "unqualified"]

  expect_true(all(emoji_detect(mini_q_emojis)))
  expect_true(all(emoji_detect(fully_q_emojis)))
  expect_true(all(emoji_detect(component_emojis)))
  expect_false(all(emoji_detect(unqualified_emojis)))
  expect_false(any(emoji_detect(letters)))
})

Try the emoji package in your browser

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

emoji documentation built on Oct. 30, 2024, 9:28 a.m.