1library(pystr) 2context("pystr_isupper") 3 4test_that("it returns false if there's lowercase", { 5 expect_false(pystr_isupper("ABc")) 6}) 7 8test_that("it returns true if it's all capitals", { 9 expect_true(pystr_isupper("ABC")) 10}) 11 12test_that("the presence of punctuation and numerics doesn't matter", { 13 expect_true(pystr_isupper("ABC123!")) 14}) 15 16test_that("it returns false if there are no cased characters", { 17 expect_false(pystr_isupper("?!.")) 18}) 19 20test_that("Vectors are supported", { 21 expect_equal(pystr_isupper(c("?!.", "Foo", "FOO")), c(FALSE, FALSE, TRUE)) 22}) 23 24test_that("NA values are supported", { 25 expect_equal(pystr_isupper(c("?!.", "Foo", NA)), c(FALSE, FALSE, NA)) 26}) 27