tests/testthat/test-op-concat.R

test_that("it validates arguments `x` and `y`", {
    expect_snapshot(1L  %+% "1", error = TRUE)
    expect_snapshot("1" %+% 1L,  error = TRUE)
})

test_that("it concatenates strings together separated by a single space", {
    string1 <- "foo"
    string2 <- "baz"

    expect_identical(string1 %+% string2, paste(string1, string2, sep = " "))
    expect_identical("foo" %+% "", "foo ")
})
jeanmathieupotvin/dotprofile documentation built on Dec. 20, 2021, 10:08 p.m.