tests/testthat/test-format_capitalize.R

test_that("format_capitalize", {
  expect_equal(format_capitalize("hello"), "Hello")
  expect_equal(format_capitalize(c("hello", "world")), c("Hello", "World"))
  expect_equal(
    unique(format_capitalize(iris$Species)),
    c("Setosa", "Versicolor", "Virginica")
  )
})

Try the insight package in your browser

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

insight documentation built on Nov. 26, 2023, 5:08 p.m.