test: 覆盖率提升至 100%(fail_under 90→99,13 个防御/边界用例)

This commit is contained in:
lhl
2026-08-09 04:49:29 +08:00
parent 737911cf25
commit 2fbff07d3f
10 changed files with 180 additions and 46 deletions
+18 -1
View File
@@ -29,4 +29,21 @@ def test_classify_sheet_mixed_with_bullet_line():
def test_classify_sheet_mixed_with_square_line():
m = [["ID", "名前"], ["1", "田中"], ["■備考行"]]
assert classify_sheet(m) == SheetNature.MIXED
assert classify_sheet(m) == SheetNature.MIXED
def test_classify_empty_matrix_is_free_text():
# 空矩阵:_free_text_like 对空矩阵返回 TrueL26 分支)
assert classify_sheet([]) == SheetNature.FREE_TEXT
def test_classify_sparse_multicol_is_free_text():
# 多列但非空行占比 < 0.7 → FREE_TEXTL32 稀疏分支)
m = [["ID", "名前"], [], [], [], [], ["1", "田中"]]
assert classify_sheet(m) == SheetNature.FREE_TEXT
def test_classify_header_no_bullet_is_table():
# 表头有效且无 ・/■ 行 → 落入 TABLE(L40→44 无匹配循环路径)
m = [["ID", "名前"], ["1", "田中"], ["2", "佐藤"]]
assert classify_sheet(m) == SheetNature.TABLE