From 631efdf9979a4d07d75c801b42d04e03c915c871 Mon Sep 17 00:00:00 2001 From: Denini Gabriel Date: Fri, 8 Aug 2025 12:54:03 +0000 Subject: [PATCH] fix: a test was breaking on windows and add others --- aish/tests/test_strformat_utils.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/aish/tests/test_strformat_utils.py b/aish/tests/test_strformat_utils.py index 4c0e196..8671d47 100644 --- a/aish/tests/test_strformat_utils.py +++ b/aish/tests/test_strformat_utils.py @@ -17,5 +17,30 @@ def test_get_only_text_in_intervals(): def test_get_only_text_in_intervals2(): - result = get_highlighted_text("0123456789", ((0, 4), (7, 10)), excluded_exscape="-") + result = get_highlighted_text("0123456789", ((0, 4), (7, 10)), exclude_filler="-") assert result == "0123---789" + + +def test_get_only_text_in_intervals_empty(): + result = get_only_text_in_intervals("0123456789", (), exclude_filler="-") + assert result == "----------" + + +def test_get_only_text_in_intervals_single(): + result = get_only_text_in_intervals("0123456789", ((2, 5),), exclude_filler="*") + assert result == "**234*****" + + +def test_get_highlighted_text_empty_intervals(): + result = get_highlighted_text("0123456789", (), "S", "E", "!") + assert result == "E0123456789!" + + +def test_get_highlighted_text_adjacent_intervals(): + result = get_highlighted_text("0123456789", ((0, 3), (3, 6)), "S", "E", "!") + assert result == "S012ES345E6789!" + + +def test_get_highlighted_text_single_char(): + result = get_highlighted_text("abc", ((1, 2),), "[", "]", "") + assert result == "]a[b]c"