tests/testthat/test-change_case.R

context("Ensure that change case works consistently")

test_that("Snake case converts correctly",{
  
  expect_equal(to_snake("nochange"), "nochange")
  expect_equal(to_snake("^snake*"), "_snake_")
  expect_equal(to_snake("snAke"), "snake")
  expect_equal(to_snake("snake case"), "snake_case")
  expect_equal(to_snake(""), "")
  
  expect_equal(to_snake(NA_character_), NA_character_)
  
  
})

Try the FAOSTAT package in your browser

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

FAOSTAT documentation built on March 31, 2023, 8:31 p.m.