tests/testthat/test-combine_words_ptbr.R

test_that("combine_words_ptbr works", {
  x <- c("A", "B", "C", "D")
  expect_equal(combine_words_ptbr(x), c("A, B, C e D"))
})

test_that("combine_words_ptbr works changing sep argument", {
  x <- c("A", "B", "C", "D")
  expect_equal(combine_words_ptbr(x, sep = "; "), c("A; B; C e D"))
})

test_that("combine_words_ptbr works changing last argument", {
  x <- c("A", "B", "C", "D")
  expect_equal(combine_words_ptbr(x, last = " and "), c("A, B, C and D"))
})

Try the misc package in your browser

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

misc documentation built on April 8, 2026, 9:10 a.m.