tests/testthat/test-pretty_text.R

###############################################################################
## Title: Test pretty_text() function
## Project: parseRPDR
## Description: Test pretty_text() function
## Copyright: Márton Kolossváry, MD, PhD
## Date: 2023-02-24
###############################################################################

testthat::skip_if_offline()
# Load and check equality ====================
suppressPackageStartupMessages(library(parseRPDR))

test_that("pretty_text() - remove after", {
  expect_equal("abc", pretty_text("abc-zyx", remove_after = TRUE))
})

test_that("pretty_text() - remove punctuation", {
  expect_equal("abc", pretty_text("abc.!", remove_punc = TRUE))
})

test_that("pretty_text() - remove punctuation", {
  expect_equal("abc", pretty_text("abc   ", remove_white = TRUE))
})

Try the parseRPDR package in your browser

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

parseRPDR documentation built on March 31, 2023, 11:36 p.m.