tests/trim.R

message("TESTING: trim()...")

library("R.oo")

x <- character(0L)
y <- trim(x)
print(y)
stopifnot(identical(y, x))

x <- "Hello world!"
y <- trim(x)
print(y)
stopifnot(identical(y, x))

x <- " \tHello world!\n "
y <- trim(x)
print(y)
stopifnot(identical(y, "Hello world!"))

x <- c(" \tHello",  "world!")
y <- trim(x)
print(y)
stopifnot(identical(y, c("Hello", "world!")))


message("TESTING: trim()...DONE")
HenrikBengtsson/R.oo documentation built on Jan. 31, 2024, 9:06 a.m.