tests/testthat/test_casing.R

context("Test upper and lower-casing")

test_that("Single strings can be lowercased",{
  result <- rope:::string_tolower_single("FOOBARBAZ")
  expect_that(result, equals("foobarbaz"))
})

test_that("Single strings can be uppercased",{
  result <- rope:::string_toupper_single("foobarbaz")
  expect_that(result, equals("FOOBARBAZ"))
})

test_that("Multiple strings can be lowercased",{
  strings <- c("barber", "Barber", "barbeR")
  result <- rope:::string_tolower_vector(strings)
  expect_that(result, equals(rep("barber",3)))
})

test_that("Multiple strings can be uppercased",{
  strings <- c("BArbeR", "Barber", "barbeR")
  result <- rope:::string_toupper_vector(strings)
  expect_that(result, equals(rep("BARBER",3)))
})
PeteHaitch/rope documentation built on May 9, 2017, 6:35 p.m.