unit test for correct answer escaping

This commit is contained in:
Eltaurus 2025-10-25 10:00:54 +06:00
parent 55e6ddfed8
commit c74a59f451

View file

@ -391,6 +391,15 @@ mod test {
assert_eq!(ctx, "<code id=typeans>123</code>");
}
#[test]
fn correct_input_is_escaped() {
let ctx = Diff::new("source <dir>/bin/activate", "source <dir>/bin/activate");
assert_eq!(
ctx.to_html(),
"<code id=typeans><span class=typeGood>source &lt;dir&gt;/bin/activate</span></code>"
);
}
#[test]
fn correct_input_is_collapsed() {
let ctx = Diff::new("123", "123");