summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-30 10:48:00 +0100
committerMartin Fischer <martin@push-f.com>2021-11-30 11:22:35 +0100
commit414e5838618123cb00216a7426b898aab88ee45a (patch)
tree92c746b8032df00e1d37e22797ec88f17b5f6148 /src
parent0420ea72655b74ae6e6f0add1f82f5da687f9a76 (diff)
refactor: use assert_matches! for named_entities test
Diffstat (limited to 'src')
-rw-r--r--src/tokenizer/mod.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/tokenizer/mod.rs b/src/tokenizer/mod.rs
index 78101f6..6793eb2 100644
--- a/src/tokenizer/mod.rs
+++ b/src/tokenizer/mod.rs
@@ -2446,15 +2446,17 @@ mod test {
let opts = opts();
let vector = vec![String::from("&amp;\r\n"), String::from("&aamp;\r\n")];
- let expected = vec![
- (3, CharacterTokens("&\n".into())),
- (
- 3,
- ParseError(Error::CharRef(CharRefError::InvalidNamedCharRef)),
- ),
- (4, CharacterTokens("&aamp;\n".into())),
- ];
let results = tokenize(vector, opts);
- assert_eq!(results, expected);
+ assert_matches!(
+ &results[..],
+ [
+ (3, CharacterTokens(c1)),
+ (
+ 3,
+ ParseError(Error::CharRef(CharRefError::InvalidNamedCharRef)),
+ ),
+ (4, CharacterTokens(c2)),
+ ] if c1 == "&\n" && c2 == "&aamp;\n"
+ );
}
}