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.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/test_spans.rs b/tests/test_spans.rs
index a3d1c96..9cc745c 100644
--- a/tests/test_spans.rs
+++ b/tests/test_spans.rs
@@ -29,9 +29,22 @@ fn test() {
.infallible()
{
if let Token::StartTag(tag) = token {
- labels.push(Label::primary(file_id, tag.name_span).with_message("start tag"));
+ if tag.name == "h1" {
+ labels.push(Label::primary(file_id, tag.name_span).with_message("start tag"));
+ } else {
+ for attr in tag.attributes.values() {
+ labels.push(
+ Label::primary(file_id, attr.name_span.clone()).with_message("attr name"),
+ );
+ labels.push(
+ Label::primary(file_id, attr.value_span.clone()).with_message("attr value"),
+ );
+ }
+ }
} else if let Token::EndTag(tag) = token {
- labels.push(Label::primary(file_id, tag.name_span).with_message("end tag"));
+ if tag.name == "h1" {
+ labels.push(Label::primary(file_id, tag.name_span).with_message("end tag"));
+ }
}
}