tests/testthat/test_fun_string.R

context("Strings")

test_that("proper capitalizes all words", {
  x <- c('the frog saw an empty lake when he arrived', 'wHat in the Hell iS gOing on')
  z <- c('The Frog Saw An Empty Lake When He Arrived', 'What In The Hell Is Going On')

  expect_identical(proper(x[1]), z[1])
  expect_identical(proper(x[2]), z[2])
})

Try the loose.rock package in your browser

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

loose.rock documentation built on April 30, 2021, 1:06 a.m.