aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-09-04 08:46:59 +0200
committerMartin Fischer <martin@push-f.com>2023-09-28 07:26:44 +0200
commit049e17c0a3a0a522db90fbdbb3cf1c5106fb15fb (patch)
tree47d06527b84870ace3d0279624e911287eae0807
parent62e78ac5d17f50cbfe94d50b7d92ba5fe51acb8e (diff)
chore: rename internal tokenizer helper fn to parser
-rw-r--r--tests/test_spans.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_spans.rs b/tests/test_spans.rs
index 718a176..a8bf97c 100644
--- a/tests/test_spans.rs
+++ b/tests/test_spans.rs
@@ -10,7 +10,7 @@ use html5tokenizer::{offset::PosTrackingReader, NaiveParser, Token};
use insta::assert_snapshot;
use similar_asserts::assert_eq;
-fn tokenizer(html: &'static str) -> impl Iterator<Item = Token<usize>> {
+fn parser(html: &'static str) -> impl Iterator<Item = Token<usize>> {
NaiveParser::new(PosTrackingReader::new(html)).flatten()
}
@@ -22,7 +22,7 @@ fn test_and_annotate<S: AsRef<str> + Clone>(
html: &'static str,
labeler: impl Fn(TokenIter) -> Vec<(Range<usize>, S)>,
) -> String {
- let labels = labeler(Box::new(tokenizer(html)));
+ let labels = labeler(Box::new(parser(html)));
assert_char_encoding_independence(html, labeler);
@@ -250,7 +250,7 @@ fn comment_data_span() {
"###);
for (idx, case) in cases.iter().enumerate() {
- let Token::Comment(comment) = tokenizer(case)
+ let Token::Comment(comment) = parser(case)
.filter(|t| !matches!(t, Token::Error { .. }))
.next()
.unwrap()
@@ -333,7 +333,7 @@ fn doctype_id_spans() {
}
fn annotate_errors(html: &'static str) -> String {
- for token in tokenizer(html) {
+ for token in parser(html) {
let Token::Error { span, .. } = token else {
continue;
};