diff --git a/core/tests/runner/mod.rs b/core/tests/runner/mod.rs index 29dbae67..2f4fcc35 100644 --- a/core/tests/runner/mod.rs +++ b/core/tests/runner/mod.rs @@ -65,20 +65,19 @@ fn run_spec_test(case: test_runner::test_file::TestCase) { } fn run_snap_test(case: test_runner::test_file::TestCase) { - let tokens = unimarkup_commons::lexer::token::lex_str(&case.test.input); - - let mut snap_runner = SnapTestRunner::with_fn::<_, _>(&case.test.name, &tokens, |_input| { - let um = unimarkup_core::parser::parse_unimarkup( - &case.test.input, - unimarkup_commons::config::Config::default(), - ); - - Snapshot(um.blocks).as_snapshot() - }) - .with_info(format!( - "Test '{}' from: {}", - case.test.name, case.file_path - )); + let mut snap_runner = + SnapTestRunner::with_fn::<_, _>(&case.test.name, &case.test.input, |_input| { + let um = unimarkup_core::parser::parse_unimarkup( + &case.test.input, + unimarkup_commons::config::Config::default(), + ); + + Snapshot(um.blocks).as_snapshot() + }) + .with_info(format!( + "Test '{}' from: {}", + case.test.name, case.file_path + )); if let Some(ref description) = case.test.description { snap_runner = snap_runner.with_description(description); diff --git a/inline/tests/parser/mod.rs b/inline/tests/parser/mod.rs index 6001404f..7698e6f0 100644 --- a/inline/tests/parser/mod.rs +++ b/inline/tests/parser/mod.rs @@ -65,11 +65,12 @@ fn run_spec_test(case: test_runner::test_file::TestCase) { } fn run_snap_test(case: test_runner::test_file::TestCase) { - let tokens = unimarkup_commons::lexer::token::lex_str(&case.test.input); + let runner = SnapTestRunner::with_fn(&case.test.name, &case.test.input, |input| { + let slice: &[_] = &unimarkup_commons::lexer::token::lex_str(input); + let token_iterator = slice.into(); - let runner = SnapTestRunner::with_fn(&case.test.name, &tokens, |slice| { let (_, _, parsed_inlines) = unimarkup_inline::parser::parse_inlines( - slice.into(), + token_iterator, InlineContext::default(), None, None,