test: 覆盖率提升至 100%(fail_under 90→99,13 个防御/边界用例)
This commit is contained in:
@@ -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 对空矩阵返回 True(L26 分支)
|
||||
assert classify_sheet([]) == SheetNature.FREE_TEXT
|
||||
|
||||
|
||||
def test_classify_sparse_multicol_is_free_text():
|
||||
# 多列但非空行占比 < 0.7 → FREE_TEXT(L32 稀疏分支)
|
||||
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
|
||||
Reference in New Issue
Block a user