/usr/share/doc/r-cran-tibble/tests/testthat/test-utils-format.R is in r-cran-tibble 1.4.1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | context("utils-format")
test_that("pluralise works correctly", {
expect_identical(pluralise("[an] index(es)", c("x")), "an index")
expect_identical(pluralise("[an] index(es)", c("x", "y")), "indexes")
})
test_that("pluralise leaves alone parentheses / square brackets that have spaces inside", {
expect_identical(
pluralise("[an] invalid index(es) (be careful) [for real]", c("x")),
"an invalid index (be careful) [for real]"
)
expect_identical(
pluralise("[an] invalid index(es) (be careful) [for real]", c("x", "y")),
"invalid indexes (be careful) [for real]"
)
})
test_that("pluralise_msg works correctly", {
expect_identical(pluralise_msg("[an] index(es) ", c("x")), "an index `x`")
expect_identical(pluralise_msg("[an] index(es) ", c("x", "y")), "indexes `x`, `y`")
expect_identical(pluralise_msg("[an] index(es) ", c(-4, -5)), "indexes -4, -5")
})
|