diff --git a/CHANGELOG.md b/CHANGELOG.md index 249630b2..2176f2cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Performance: `--coverage` is roughly 5x faster and `--coverage-report-html` roughly 19x — a run over this repo went from 16.2s to 2.9s, and a 128-file HTML report from 58.7s to 3.1s. The report phase emits each format in one awk invocation per run instead of Bash loops and forks per file and per row, and the capture path writes records straight to disk, normalizes a path with one fork instead of four, and reads each cache once (#1092, #1096, #1098, #1099, #1102, #1104, #1110, #1117) ### Fixed +- The HTML report escapes test titles instead of writing them into the markup. A title is user text, so `bashunit::set_test_title "')" + + assert_not_contains "" "$html" + assert_contains "<script>" "$html" +} + +function test_a_title_with_an_ampersand_is_escaped() { + local html + html="$(_report_with_title 'a & b')" + + assert_contains "a & b" "$html" +} + +# The row is stored and split on a delimiter, so a title carrying it must not +# shift the columns: the status cell has to hold a status, not a fragment. +function test_a_title_with_a_pipe_keeps_the_columns_aligned() { + local html + html="$(_report_with_title 'before|after')" + + assert_contains 'class="passed"' "$html" + assert_not_contains 'class="after"' "$html" + assert_contains "