14 lines
364 B
Python
Raw Normal View History

2024-09-28 17:38:53 +08:00
def test_append_newline():
def check_append_newline(key):
append_newline = len(key.split('.')) == 2
return append_newline
2024-09-27 17:03:46 +08:00
2024-09-28 17:38:53 +08:00
# 测试用例
test_cases = ["1.1", "1."]
2024-09-23 15:49:30 +08:00
2024-09-28 17:38:53 +08:00
for case in test_cases:
result = check_append_newline(case)
print(f"序号 '{case}': append_newline = {result}")
2024-09-23 15:49:30 +08:00
2024-09-28 17:38:53 +08:00
# 运行测试
test_append_newline()