tests/testthat/test-first_to_upper.R

test_that("only first of several lowercase letters of string is uppercased, later words in smae string unaffected", {
  expect_equal(first_to_upper("hi there jon"), "Hi there jon")
})

test_that("only first lowercase letters is uppercased", {
  expect_equal(first_to_upper("hi there"), "Hi there")
})

test_that("a string begining with a numeral is handled okay", {
  expect_equal(first_to_upper("1way to know"), "1way to know")
})

test_that("integers are converted to strings", {
  expect_equal(first_to_upper(56L), "56")
})

test_that("doubles are converted to strings", {
  expect_equal(first_to_upper(exp(1)), "2.71828182845905")
})
Kidapt/keda documentation built on Nov. 23, 2019, 3:35 a.m.