aboutsummaryrefslogtreecommitdiff
path: root/tests/test_spans.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-30 19:11:19 +0100
committerMartin Fischer <martin@push-f.com>2021-12-05 02:52:36 +0100
commitf9639d724e1a6f1e8edaeafa78c2c3d8b43640a3 (patch)
tree643dfe2a34082edb6b7ca3bd293f59f343766e10 /tests/test_spans.rs
parent042409a2c40bb997739326928eab7d0430cec50b (diff)
spans: add spans to Token::Error
Diffstat (limited to 'tests/test_spans.rs')
-rw-r--r--tests/test_spans.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_spans.rs b/tests/test_spans.rs
index 9cc745c..aeb4a94 100644
--- a/tests/test_spans.rs
+++ b/tests/test_spans.rs
@@ -31,7 +31,7 @@ fn test() {
if let Token::StartTag(tag) = token {
if tag.name == "h1" {
labels.push(Label::primary(file_id, tag.name_span).with_message("start tag"));
- } else {
+ } else if tag.name == "input" {
for attr in tag.attributes.values() {
labels.push(
Label::primary(file_id, attr.name_span.clone()).with_message("attr name"),
@@ -45,6 +45,8 @@ fn test() {
if tag.name == "h1" {
labels.push(Label::primary(file_id, tag.name_span).with_message("end tag"));
}
+ } else if let Token::Error { error, span } = token {
+ labels.push(Label::primary(file_id, span).with_message(error.to_string()));
}
}