tests/testthat/test-prefix.R

context("test word prefix")

test_that("test unique prefix", {
  expect_equal(object = add_prefix(c("this is a test", "this is another test"), "#"),
               expected = c("#this #is #a #test", 
                            "#this #is #another #test"))
})

test_that("test multiple prefixes", {
  expect_equal(object = add_prefix(c("this is a test", "this is another test"), c("#", "*")),
               expected = c("#this #is #a #test", 
                            "*this *is *another *test"))
})

Try the fastrtext package in your browser

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

fastrtext documentation built on Oct. 30, 2019, 11:32 a.m.