diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_spans.rs | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/tests/test_spans.rs b/tests/test_spans.rs index d3e62ae..bc6aeee 100644 --- a/tests/test_spans.rs +++ b/tests/test_spans.rs @@ -132,6 +132,22 @@ fn attribute_value_span() {  }  #[test] +fn attribute_value_with_char_ref() { +    let html = "<test x=& y='&' z=\"&\">"; +    let mut labels = Vec::new(); +    let Token::StartTag(tag) = tokenizer(html).next().unwrap() else { +        panic!("expected start tag") +    }; +    for attr in &tag.attributes { +        labels.push((attr.value_span().unwrap(), "")); +    } +    assert_snapshot!(annotate(html, labels), @r###" +    <test x=& y='&' z="&"> +            ^        ^         ^ +    "###); +} + +#[test]  fn comment_proper_data_span() {      let html = "<!-- Why are you looking at the source code? -->";      let Token::Comment(comment) = tokenizer(html).next().unwrap() else { | 
