test(wave75): domain utils补充单测 +54 (#883)
This commit is contained in:
@@ -244,6 +244,16 @@ class TestWrapText:
|
||||
result = _wrap_text(text, 1)
|
||||
assert result == ["a", "b", "c"]
|
||||
|
||||
def test_max_chars_zero(self):
|
||||
# 边界情况
|
||||
text = "abc"
|
||||
result = _wrap_text(text, 0)
|
||||
# 0的话,max_chars//2也是0,range不会执行
|
||||
# 按逻辑 len(text) > 0 成立,但 break_point 从 0 开始
|
||||
# 这取决于具体实现,只要不崩溃就行
|
||||
assert isinstance(result, list)
|
||||
assert len(result) > 0
|
||||
|
||||
def test_punctuation_at_boundary(self):
|
||||
# 标点刚好在 max_chars 位置
|
||||
text = "一二三四五六七八九。"
|
||||
|
||||
Reference in New Issue
Block a user