aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_spans.rs48
1 files changed, 48 insertions, 0 deletions
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
@@ -261,6 +261,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 = "<!--";
+ assert_snapshot!(annotate_errors(html), @r###"
+ <!--
+ ^ eof-in-comment
+ "###);
+}
+
+#[test]
+fn error_eof_in_doctype() {
+ let html = "<!doctype html";
+ assert_snapshot!(annotate_errors(html), @r###"
+ <!doctype html
+ ^ eof-in-doctype
+ "###);
+}
+
+#[test]
+fn error_eof_in_script_html_comment_like_text() {
+ let html = "<script><!--";
+ assert_snapshot!(annotate_errors(html), @r###"
+ <script><!--
+ ^ eof-in-script-html-comment-like-text
+ "###);
+}
+
+#[test]
+fn error_eof_in_tag() {
+ let html = "</sarcasm";
+ assert_snapshot!(annotate_errors(html), @r###"
+ </sarcasm
+ ^ eof-in-tag
+ "###);
+}
+
+#[test]
fn error_invalid_first_character_of_tag_name() {
let html = "Please mind the gap: < test";
assert_snapshot!(annotate_errors(html), @r###"