2024-11-18 21:32:33 +08:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
from core.tools.utils.text_processing_utils import remove_leading_symbols
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
|
("input_text", "expected_output"),
|
|
|
|
|
[
|
|
|
|
|
("...Hello, World!", "Hello, World!"),
|
|
|
|
|
("。测试中文标点", "测试中文标点"),
|
2025-12-09 14:41:46 +08:00
|
|
|
# Note: ! is not in the removal pattern, only @# are removed, leaving "!Test symbols"
|
|
|
|
|
# The pattern intentionally excludes ! as per #11868 fix
|
|
|
|
|
("@#Test symbols", "Test symbols"),
|
2024-11-18 21:32:33 +08:00
|
|
|
("Hello, World!", "Hello, World!"),
|
|
|
|
|
("", ""),
|
|
|
|
|
(" ", " "),
|
2025-12-11 09:47:39 +08:00
|
|
|
("【测试】", "【测试】"),
|
2024-11-18 21:32:33 +08:00
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
def test_remove_leading_symbols(input_text, expected_output):
|
|
|
|
|
assert remove_leading_symbols(input_text) == expected_output
|