tests/testthat/test-emoji_p.R

library(testthat)

test_that("emoji_p works", {

  expect_equal(
    emoji_p(1),
    emoji("poop")
  )

  expect_equal(
    emoji_p(c(2e-6, 2e-5, 0.002, 0.02, 0.06, 0.2)),
    vapply(c("laughing", "joy", "grin", "smile", "thinking", "poop"), emoji,
           FUN.VALUE = character(1), USE.NAMES = FALSE)
  )

  expect_error(
    emoji_p("nothing")
  )
})

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.