aboutsummaryrefslogtreecommitdiff
path: root/tests/test_spans.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_spans.rs')
-rw-r--r--tests/test_spans.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/test_spans.rs b/tests/test_spans.rs
index 0956f8e..f22a2aa 100644
--- a/tests/test_spans.rs
+++ b/tests/test_spans.rs
@@ -245,6 +245,24 @@ fn tests_for_errors_are_sorted() {
}
#[test]
+fn error_char_ref_absence_of_digits() {
+ let html = "&#qux;";
+ assert_snapshot!(annotate_errors(html), @r###"
+ &#qux;
+ ^ absence-of-digits-in-numeric-character-reference
+ "###);
+}
+
+#[test]
+fn error_char_ref_control_char() {
+ let html = "";
+ assert_snapshot!(annotate_errors(html), @r###"
+ 
+ ^ control-character-reference
+ "###);
+}
+
+#[test]
fn error_char_ref_missing_semicolon() {
let html = "&not";
assert_snapshot!(annotate_errors(html), @r###"
@@ -254,6 +272,42 @@ fn error_char_ref_missing_semicolon() {
}
#[test]
+fn error_char_ref_noncharacter() {
+ let html = "";
+ assert_snapshot!(annotate_errors(html), @r###"
+ 
+ ^ noncharacter-character-reference
+ "###);
+}
+
+#[test]
+fn error_char_ref_null_char() {
+ let html = "�";
+ assert_snapshot!(annotate_errors(html), @r###"
+ �
+ ^ null-character-reference
+ "###);
+}
+
+#[test]
+fn error_char_ref_outside_unicode_range() {
+ let html = "�";
+ assert_snapshot!(annotate_errors(html), @r###"
+ �
+ ^ character-reference-outside-unicode-range
+ "###);
+}
+
+#[test]
+fn error_char_ref_surrogate() {
+ let html = "�";
+ assert_snapshot!(annotate_errors(html), @r###"
+ �
+ ^ surrogate-character-reference
+ "###);
+}
+
+#[test]
fn error_char_ref_unknown_named() {
let html = "The pirate says &arrrrr;";
assert_snapshot!(annotate_errors(html), @r###"