diff options
author | Martin Fischer <martin@push-f.com> | 2023-09-02 12:27:14 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2023-09-03 23:00:05 +0200 |
commit | e993f19c2b8ef00b32f17f9ed32306f3ceb21bc3 (patch) | |
tree | 4992456f36e6d012b4cc54a69811ec321cc4550c /tests/test_spans.rs | |
parent | c8a8bcb95b725d91a7c4b7bc7623171f2a04fc67 (diff) |
fix!: make comment data spans encoding-independent
Diffstat (limited to 'tests/test_spans.rs')
-rw-r--r-- | tests/test_spans.rs | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/tests/test_spans.rs b/tests/test_spans.rs index e856a19..ca23141 100644 --- a/tests/test_spans.rs +++ b/tests/test_spans.rs @@ -54,13 +54,6 @@ fn annotate(html: &str, labels: Vec<(Range<usize>, impl AsRef<str>)>) -> String .join("") } -fn assert_panics_but_should_not(f: impl FnOnce() + std::panic::UnwindSafe) { - assert!( - std::panic::catch_unwind(f).is_err(), - "congrats! you made some span test support UTF-16, please stop calling assert_panics_but_should_not for this test" - ); -} - #[test] fn start_tag_span() { let html = "<x> <xyz> <xyz > <xyz/>"; @@ -219,7 +212,7 @@ fn comment_data_span() { ]; let mut annotated = String::new(); - for (idx, case) in cases.iter().enumerate() { + for case in cases { let labeler = |tokens: TokenIter| { let Token::Comment(comment) = tokens .filter(|t| !matches!(t, Token::Error { .. })) @@ -231,16 +224,7 @@ fn comment_data_span() { vec![(comment.data_span(), "")] }; - println!("{idx}"); - if [ - 0, 1, 2, 3, 8, 9, 10, 11, // FIXME - ] - .contains(&idx) - { - assert_panics_but_should_not(|| assert_char_encoding_independence(case, labeler)); - } else { - assert_char_encoding_independence(case, labeler); - } + assert_char_encoding_independence(case, labeler); annotated.push_str(&test_and_annotate(case, labeler)); } |