From a3f0d87fe4f4c21e09b981ffa72535fcdf9a78ae Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Wed, 30 Aug 2023 07:29:23 +0200 Subject: test: add span tests for eof errors --- tests/test_spans.rs | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'tests') diff --git a/tests/test_spans.rs b/tests/test_spans.rs index 8f3dc8f..840e8e1 100644 --- a/tests/test_spans.rs +++ b/tests/test_spans.rs @@ -260,6 +260,54 @@ fn error_end_tag_with_trailing_solidus() { "###); } +#[test] +fn error_eof_before_tag_name() { + let html = "<"; + assert_snapshot!(annotate_errors(html), @r###" + < + ^ eof-before-tag-name + "###); +} + +// TODO: add error_eof_in_cdata test +// blocked by lack of proper tree constructor (NaiveParser doesn't parse CDATA sections) + +#[test] +fn error_eof_in_comment() { + let html = "