swh:1:snp:bdc19e867479541d0f4994ceaa711217d0dc28ed
Tip revision: 1ad2332a4119217014f512bdf05025fa6f2bb72f authored by Hadley Wickham on 09 April 2020, 13:00:02 UTC
version 1.5.1
version 1.5.1
Tip revision: 1ad2332
test-replay-html.R
context("test-replay-html.R")
# Output labelling --------------------------------------------------------
test_that("prompt added to start of each line", {
expect_equal(label_lines("a\nb\n\n", prompt = "#"), c("#a", "#b", "#"))
})
test_that("prompt is escaped", {
expect_equal(label_lines("\n", prompt = ">"), ">")
})
test_that("input is escaped", {
expect_equal(label_lines(">", prompt = ""), ">")
})
test_that("class generates line-by-line span", {
expect_equal(
label_lines("a\nb", "X", prompt = ""),
c("<span class='X'>a</span>", "<span class='X'>b</span>")
)
})