tests/testthat/test-str-crush.R

test_that("str_crush removes all spaces from all parts of string", {
  expect_equal(str_crush(" "), "")
  expect_equal(str_crush("\n \t"), "")
  expect_equal(str_crush("ab\t\tc\t"), "abc")
  expect_equal(str_crush("\ta  bc"), "abc")
  expect_equal(str_crush("\ta\t bc\t"), "abc")
})

Try the tidyplus package in your browser

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

tidyplus documentation built on April 3, 2025, 7:44 p.m.