tests/testthat/test-utils.R

context("Utils")

test_that("Inputs are verified correct", {
  expect_silent(check_input(letters))
  expect_silent(check_input(list(a = "a", b = "b")))
  expect_error(check_input(1:10))
  expect_error(check_input(list(a = "a", b = letters)))
  expect_error(check_input(list(a = "a", b = 2)))
})

test_that("Stopwords are removed", {
  expect_equal(remove_stopwords(letters[1:5], stopwords = c("d", "e")),
               letters[1:3])
})

Try the tokenizers package in your browser

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

tokenizers documentation built on Dec. 28, 2022, 2:34 a.m.