feat: 优化导出文件质量

This commit is contained in:
meijiali
2026-07-03 15:29:55 +08:00
parent 11f129c4aa
commit b14834e806
5 changed files with 54 additions and 4 deletions
+5
View File
@@ -8,7 +8,12 @@ def test_labels_to_text_joins_json_array_with_chinese_comma():
def test_safe_csv_field_prevents_formula_injection_and_newlines():
assert safe_csv_field("=1+1") == "'=1+1"
assert safe_csv_field("+1+1") == "'+1+1"
assert safe_csv_field("-1+1") == "'-1+1"
assert safe_csv_field("@SUM(1,1)") == "'@SUM(1,1)"
assert safe_csv_field("hello\nworld") == "hello world"
assert safe_csv_field("hello\r\nworld") == "hello world"
assert safe_csv_field("hello\rworld") == "hello world"
def test_safe_filename_replaces_illegal_chars_and_truncates_keyword():