summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_spans.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_spans.rs b/tests/test_spans.rs
index 0e95be0..d19d6aa 100644
--- a/tests/test_spans.rs
+++ b/tests/test_spans.rs
@@ -351,6 +351,24 @@ fn doctype_id_spans() {
"###);
}
+#[test]
+fn eof_offset() {
+ let html = "Where does it end?";
+ let labeler = |parser: Parser| {
+ let mut labels = Vec::new();
+ for (_, trace) in parser.flatten() {
+ if let Trace::EndOfFile(offset) = trace {
+ labels.push((offset..offset, "here"));
+ }
+ }
+ labels
+ };
+ assert_snapshot!(test_and_annotate(html, labeler), @r###"
+ Where does it end?
+ ^ here
+ "###);
+}
+
fn annotate_errors(html: &'static str) -> String {
let mut parser = parser(html);
for _ in parser.by_ref() {}