refactor: improve handling of leading punctuation removal (#10761)
This commit is contained in:
20
api/tests/unit_tests/utils/test_text_processing.py
Normal file
20
api/tests/unit_tests/utils/test_text_processing.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
|
||||
from core.tools.utils.text_processing_utils import remove_leading_symbols
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("input_text", "expected_output"),
|
||||
[
|
||||
("...Hello, World!", "Hello, World!"),
|
||||
("。测试中文标点", "测试中文标点"),
|
||||
("!@#Test symbols", "Test symbols"),
|
||||
("Hello, World!", "Hello, World!"),
|
||||
("", ""),
|
||||
(" ", " "),
|
||||
],
|
||||
)
|
||||
def test_remove_leading_symbols(input_text, expected_output):
|
||||
assert remove_leading_symbols(input_text) == expected_output
|
Reference in New Issue
Block a user