aboutsummaryrefslogtreecommitdiff
path: root/integration_tests/tests/test_html5lib.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-09-12 09:26:06 +0200
committerMartin Fischer <martin@push-f.com>2023-09-28 10:36:08 +0200
commita03cea75d9d120a7519be91ec872b143b5d74276 (patch)
tree5f8adef72451c035eb42ccad0b57f2146481c5a9 /integration_tests/tests/test_html5lib.rs
parent14bc6f2cceed0fa578d6a1195266885bf57a5d4c (diff)
refactor: make TracingEmitter only work with usizes
Diffstat (limited to 'integration_tests/tests/test_html5lib.rs')
-rw-r--r--integration_tests/tests/test_html5lib.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/integration_tests/tests/test_html5lib.rs b/integration_tests/tests/test_html5lib.rs
index 0040a01..eac11dd 100644
--- a/integration_tests/tests/test_html5lib.rs
+++ b/integration_tests/tests/test_html5lib.rs
@@ -4,7 +4,7 @@ use html5lib_tests::{
parse_tests, Error as TestError, InitialState, Output, Test, Token as TestToken,
};
use html5tokenizer::{
- offset::{Offset, Position},
+ offset::{Offset, PosTrackingReader, Position},
reader::Reader,
CdataAction, Emitter, Error, Event, InternalState, Token, Tokenizer, TracingEmitter,
};
@@ -75,7 +75,10 @@ fn run_test(fname: &str, test_i: usize, test: Test) {
test_i,
&test,
state,
- Tokenizer::new(&test.input, TracingEmitter::default()),
+ Tokenizer::new(
+ PosTrackingReader::new(&test.input),
+ TracingEmitter::default(),
+ ),
"TracingEmitter string",
);
@@ -85,7 +88,7 @@ fn run_test(fname: &str, test_i: usize, test: Test) {
&test,
state,
Tokenizer::new(
- BufReader::new(test.input.as_bytes()),
+ PosTrackingReader::new(BufReader::new(test.input.as_bytes())),
TracingEmitter::default(),
),
"TracingEmitter bufread",
@@ -183,8 +186,8 @@ trait DrainErrors<O> {
fn drain_errors(&mut self) -> Box<dyn Iterator<Item = (Error, Range<O>)> + '_>;
}
-impl<O> DrainErrors<O> for TracingEmitter<O> {
- fn drain_errors(&mut self) -> Box<dyn Iterator<Item = (Error, Range<O>)> + '_> {
+impl DrainErrors<usize> for TracingEmitter {
+ fn drain_errors(&mut self) -> Box<dyn Iterator<Item = (Error, Range<usize>)> + '_> {
Box::new(self.drain_errors())
}
}