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")

Try the R.oo package in your browser

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

R.oo documentation built on June 12, 2022, 9:05 a.m.