tests/testthat/test-format_nonbreaking.R

context("format_nonbreaking")

test_that("spaces", {

  x <- c("foo bar baz")

  expect_equal(
    format_nonbreaking(x),
    str_c("foo", "bar", "baz", sep = "\u00A0"))

})

test_that("hyphens", {

  x <- c("foo-bar-baz")

  expect_equal(
    format_nonbreaking(x),
    str_c("foo", "bar", "baz", sep = "\u2011"))

})
BAAQMD/strtools documentation built on Nov. 23, 2023, 5:52 a.m.