From e993f19c2b8ef00b32f17f9ed32306f3ceb21bc3 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 2 Sep 2023 12:27:14 +0200 Subject: fix!: make comment data spans encoding-independent --- tests/test_spans.rs | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'tests') 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, impl AsRef)>) -> 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 = " "; @@ -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)); } -- cgit v1.2.3