test_that("highlightCondition highlights single predicate correctly", {
res <- highlightCondition("A=1")
expect_match(res, "^A=1$")
})
test_that("highlightCondition highlights multiple predicates separated by commas", {
res <- highlightCondition("A=1,B=2")
# It should insert
between predicates
expect_match(res, "A=1
B=2")
# Exactly two predicate-name spans
expect_equal(length(regmatches(res, gregexpr("class=\"pred_n\"", res))[[1]]), 2)
})
test_that("highlightCondition removes braces", {
res <- highlightCondition("{A=1,B=2}")
expect_false(grepl("[{}]", res))
})
test_that("highlightCondition escapes HTML special characters", {
res <- highlightCondition("A=