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"