diff options
author | Martin Fischer <martin@push-f.com> | 2023-08-12 12:58:08 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2023-08-19 13:53:58 +0200 |
commit | 0d9cd9ed44b676ccd4991cea27dc620b94ebe7e7 (patch) | |
tree | aba2bff89958bbe4516a49caba5edffc866c64af /tests/test_spans.rs | |
parent | b125bec9914bd211d77719bd60bc5a23bd9db579 (diff) |
feat: introduce NaiveParser
Diffstat (limited to 'tests/test_spans.rs')
-rw-r--r-- | tests/test_spans.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/test_spans.rs b/tests/test_spans.rs index 791f1a6..d3e62ae 100644 --- a/tests/test_spans.rs +++ b/tests/test_spans.rs @@ -1,4 +1,3 @@ -#![cfg(feature = "integration-tests")] // TODO: switch to NaiveParser API use std::ops::Range; use codespan_reporting::{ @@ -7,16 +6,12 @@ use codespan_reporting::{ files::SimpleFiles, term::{self, termcolor::Buffer}, }; -use html5tokenizer::{offset::PosTrackingReader, DefaultEmitter, Token, Tokenizer}; +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>> { - Tokenizer::new( - PosTrackingReader::new(html), - DefaultEmitter::<usize>::default(), - ) - .flatten() + NaiveParser::new(PosTrackingReader::new(html)).flatten() } fn annotate(html: &str, labels: Vec<(Range<usize>, impl AsRef<str>)>) -> String { |