tests/testthat/test-camelCase.R

test_that("camelCase() handles NAs", {
  expect_true(is.na(camelCase(NA)))
})

test_that("camelCase() handles spaces", {
  expect_equal(camelCase("begins with"), "beginsWith")
})

test_that("camelCase() handles Front Caps", {
  expect_equal(camelCase("Begins with"), "beginsWith")
})

test_that("camelCase() handles punctuation", {
  expect_equal(camelCase("begins_with/!"), "beginsWith")
})

test_that("camelCase() returns single words without lowercasing the whole word", {
  expect_equal(camelCase("phonemeM"), "phonemeM")
})

test_that("camelCase() handles vectors", {
  expect_equal(
    camelCase(c("phonemeM", NA, 123, "hey There campse 12324YDfnD")),
    c("phonemeM", NA, "123", "heyThereCampse12324ydfnd")
  )
})
Kidapt/keda documentation built on Nov. 23, 2019, 3:35 a.m.