tests/testthat/test-utils.R

context("Checking utils")

test_that("paste2 pastes multiple columns",{

    expect_equal(paste2(list(1:5, 1:5, 1:5)), c("1.1.1", "2.2.2", "3.3.3", "4.4.4", "5.5.5"))
    expect_equal(paste2(list(1:5, 1:5, c(1:4, " 5")), trim=FALSE), c("1.1.1", "2.2.2", "3.3.3", "4.4.4", "5.5. 5"))
    expect_equal(paste2(list(1:5, 1:5, c(1:4, NA)), handle.na = FALSE), c("1.1.1", "2.2.2", "3.3.3", "4.4.4", "5.5.NA"))
})

test_that("SE gives a number",{

    expect_true(is.numeric(SE(1:10)))

})

Try the sentimentr package in your browser

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

sentimentr documentation built on Oct. 12, 2021, 9:06 a.m.