feat(779-5): 블록 안 줄 칠 순수 셈 — 블록 줄 [[행, 상태, 차]] → 출처 행만 · 머리 행 = 가장 나쁜 줄
- SheetMap `unitTone`(이어짐 초록 · 금액 참고 차 = 주황 · 후보 파랑 · 못 이음 빨강 · 밖 흐림) · 줄 재료 없으면 옛 블록 칠 - 서버 줄 상태(D-2 뒤 Marks 덧칸)는 다음 커밋 - 시험 새 test_779_5_block_line_tone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
"""779-5 블록 안 줄 칠(`logic/M02_MasterTemplete_Hopyo_SheetMap.ts` · Node) — 블록 `줄 [[행, 상태, 차]]` →
|
||||
출처 행만 칠(이어짐 초록 · 차 있으면 주황 · 후보 파랑 · 못 이음 빨강 · 밖 흐림) · 머리 행 = 가장 나쁜 칠 ·
|
||||
목록 행 = 머리와 같음 · 줄 재료 없으면 옛 블록 칠(범위 통째)."""
|
||||
|
||||
from resources.tester.test_779_4_sheet_map import _node
|
||||
|
||||
GRID = {
|
||||
"호표": [],
|
||||
"단산": [{"번": 1, "행": [10, 20]}, {"번": 2, "행": [21, 30]}],
|
||||
"보기": {"일위대가표": "s1", "단가산출표": "s2", "단가산출상세": "s3"},
|
||||
"목록": {"호표": [], "단산": [{"번": 1, "행": 5}, {"번": 2, "행": 6}]},
|
||||
"줄": [],
|
||||
}
|
||||
|
||||
|
||||
def _mark(no, lines=None):
|
||||
m = {"번": no, "판정": "맞음", "SK": None, "갈래": None, "못옮김": []}
|
||||
return {**m, "줄": lines} if lines is not None else m
|
||||
|
||||
|
||||
def test_줄_칠_머리_가장_나쁨_옛_칠():
|
||||
lines = [[12, "이어짐", False], [13, "이어짐", True], [15, "후보", False], [16, "밖", False]]
|
||||
got = _node({"grid": GRID, "blocks": [_mark(1, lines), _mark(2)]})["paint"]
|
||||
detail, listing = got["s3"], got["s2"]
|
||||
assert {r: detail[str(r)] for r in (12, 13, 15, 16)} == {
|
||||
12: "success",
|
||||
13: "warning",
|
||||
15: "info",
|
||||
16: "muted",
|
||||
}
|
||||
assert detail["10"] == "info" and listing["5"] == "info" # 머리 · 목록 = 가장 나쁜 줄
|
||||
assert [r for r in range(10, 21) if str(r) in detail] == [10, 12, 13, 15, 16] # 줄 행만
|
||||
assert all(detail[str(r)] == "success" for r in range(21, 31)) # 줄 재료 없음 = 옛 칠
|
||||
worst = _node(
|
||||
{"grid": GRID, "blocks": [_mark(1, [[12, "이어짐", False], [14, "못 이음", False]])]}
|
||||
)
|
||||
assert worst["paint"]["s3"]["10"] == "danger" and worst["paint"]["s3"]["14"] == "danger"
|
||||
Reference in New Issue
Block a user