diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-30 10:48:00 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-30 11:22:35 +0100 |
commit | 414e5838618123cb00216a7426b898aab88ee45a (patch) | |
tree | 92c746b8032df00e1d37e22797ec88f17b5f6148 /src/tokenizer | |
parent | 0420ea72655b74ae6e6f0add1f82f5da687f9a76 (diff) |
refactor: use assert_matches! for named_entities test
Diffstat (limited to 'src/tokenizer')
-rw-r--r-- | src/tokenizer/mod.rs | 20 |
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("&\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" + ); } } |