tests/testthat/test-rm_endmark.R

context("Checking rm_endmark")

test_that("rm_endmark is removing/replacing emoticon strings",{

    x <- c("I like the dog.", "I want it *|", "I;", 
        "Who is| that?", "Hello world", "You...")

	x2 <- c("I like the dog", "I want it", "I;", "Who is| that", "Hello world", 
		"You")

    expect_equivalent(rm_endmark(x), x2)

})


test_that("rm_endmark is extracting emoticon strings",{

    x <- c("I like the dog.", "I want it *|", "I;", 
        "Who is| that?", "Hello world", "You...")

    x3 <- list(".", "*|", NA_character_, "?", NA_character_, "...")

    expect_equivalent(rm_endmark(x, extract=TRUE), x3)
})

Try the qdapRegex package in your browser

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

qdapRegex documentation built on Oct. 17, 2023, 5:06 p.m.