tests/testthat/test-highlight.R

context("Checking highlight")

test_that("highlight produces an HTML file",{

    sam <- sentiment_by(get_sentences(gsub("Sam-I-am", "Sam I am", sam_i_am)))
    temp <- tempdir()
    highlight(sam, open=FALSE, file = file.path(temp, "polarity.html"))
    expect_true(file.exists(file.path(temp, "polarity.html")))

})

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.