From de1c84eca37e714efdc80f5f8fd30701227c9cec Mon Sep 17 00:00:00 2001 From: Kirill Markin Date: Sun, 25 May 2025 11:20:34 +0300 Subject: [PATCH] Fix test assertion for content splitting logic - Corrected test_generate_output_content_splitting_very_small_limit to expect 10 words instead of 8 - The test now properly accounts for opening tag (2 words) + raw content (8 words) in the same segment - Reflects actual behavior where opening tag and content are grouped together when they fit within word limit --- tests/test_core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index 8f92027..1781502 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -542,8 +542,12 @@ def test_generate_output_content_splitting_very_small_limit(mock_get_tree: Magic found_raw_content_segment = True break else: - # Raw content by itself (8 words) - assert segment_wc == count_words_for_test(raw_file1_content) # 8 words + # Segment contains opening tag + raw content (2 + 8 = 10 words) + # Opening tag: (2 words) + # Raw content: "This is file one. It has eight words." (8 words) + opening_tag_word_count = 2 # + expected_word_count = opening_tag_word_count + count_words_for_test(raw_file1_content) + assert segment_wc == expected_word_count # Should be 10 words found_raw_content_segment = True break assert found_raw_content_segment, "Segment with raw file1 content not found or not matching expected structure"