From ff386e14404fcd7e9b9cc0ef75c1a7451e086609 Mon Sep 17 00:00:00 2001 From: Leynos Date: Wed, 16 Jul 2025 22:44:44 +0100 Subject: [PATCH 1/3] Add test for wrapping footnote collections --- tests/integration.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index 507ddf99..87dd4680 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -742,6 +742,26 @@ fn test_wrap_footnote_with_inline_code() { common::assert_wrapped_list_item(&output, " [^code_note]: ", 2); } +#[test] +fn test_wrap_footnote_collection() { + let input = vec![ + "[^1]: ", + "[^2]: ", + "[^3]: ", + "[^4]: ", + "[^5]: ", + "[^6]: ", + "[^7]: ", + "[^8]: ", + ] + .into_iter() + .map(str::to_string) + .collect::>(); + + let output = process_stream(&input); + assert_eq!(output, input); +} + #[test] /// Verifies that short list items are not wrapped or altered by the stream processing logic. /// From 5123dc9613df8ebd24a81a469278add7f9c6ba73 Mon Sep 17 00:00:00 2001 From: Leynos Date: Wed, 16 Jul 2025 23:05:31 +0100 Subject: [PATCH 2/3] Add doc comment for footnote test --- tests/integration.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index 87dd4680..24f71236 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -742,6 +742,21 @@ fn test_wrap_footnote_with_inline_code() { common::assert_wrapped_list_item(&output, " [^code_note]: ", 2); } +/// Checks that a sequence of footnotes is not altered by wrapping. +/// +/// This regression test ensures that the footnote collection remains +/// unchanged when passed to `process_stream`. +/// +/// # Examples +/// +/// ``` +/// let input = vec![ +/// "[^1]: ".to_string(), +/// "[^2]: ".to_string(), +/// ]; +/// let output = process_stream(&input); +/// assert_eq!(output, input); +/// ``` #[test] fn test_wrap_footnote_collection() { let input = vec![ From 4a2492cadf2b86358d7c38f95564a3a7445c7cb4 Mon Sep 17 00:00:00 2001 From: Leynos Date: Wed, 16 Jul 2025 23:11:20 +0100 Subject: [PATCH 3/3] Remove unneeded examples --- tests/integration.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index 24f71236..bd5b9bc6 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -746,17 +746,6 @@ fn test_wrap_footnote_with_inline_code() { /// /// This regression test ensures that the footnote collection remains /// unchanged when passed to `process_stream`. -/// -/// # Examples -/// -/// ``` -/// let input = vec![ -/// "[^1]: ".to_string(), -/// "[^2]: ".to_string(), -/// ]; -/// let output = process_stream(&input); -/// assert_eq!(output, input); -/// ``` #[test] fn test_wrap_footnote_collection() { let input = vec![ @@ -781,14 +770,6 @@ fn test_wrap_footnote_collection() { /// Verifies that short list items are not wrapped or altered by the stream processing logic. /// /// Ensures that a single-line bullet list item remains unchanged after processing. -/// -/// # Examples -/// -/// ``` -/// let input = vec!["- short item".to_string()]; -/// let output = process_stream(&input); -/// assert_eq!(output, input); -/// ``` fn test_wrap_short_list_item() { let input = vec!["- short item".to_string()]; let output = process_stream(&input);