feat(m01-sl): 표 상자 열 차례를 서버 표 블록에 맞춤 — 값 칸 범위도 아래 · 위 두 칸 · 숫자 하나는 같은 수
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ACSGaHdLgnkEkoA4LDtMU
This commit is contained in:
@@ -197,3 +197,36 @@ def test_표가_비었어도_수식이_깨지지_않음():
|
||||
empty = {**MINE, "rows": [{}, {}]}
|
||||
r = solve(empty, {"경사": "급"}, ["할증"])
|
||||
assert r["상태"] == "맞는 줄 없음" and r["할증"] == "#N/A"
|
||||
|
||||
|
||||
def test_값_칸_범위도_아래_위_두_칸_숫자_하나는_같은_수():
|
||||
"""서버 표 블록 차례 — 범위 값은 「이름·아래」 「이름·위」 · 숫자 하나면 두 칸이 같은 수."""
|
||||
table = {
|
||||
**R,
|
||||
"conds": {"높이": "범위"},
|
||||
"vals": {"증가율": "%"},
|
||||
"rule": "초과·이하",
|
||||
"rows": [{"높이": [3, 4], "증가율": [80, 100]}, {"높이": [4, None], "증가율": 30}],
|
||||
}
|
||||
low = solve(table, {"높이": 3.5}, ["증가율"])
|
||||
assert float(low["증가율·아래"]) == 80 and float(low["증가율·위"]) == 100
|
||||
one = solve(table, {"높이": 5}, ["증가율"])
|
||||
assert float(one["증가율·아래"]) == 30 and float(one["증가율·위"]) == 30
|
||||
|
||||
|
||||
def test_블록_머리_차례():
|
||||
table = {
|
||||
**R,
|
||||
"conds": {"가": "고르기", "높이": "범위"},
|
||||
"vals": {"율": "%", "폭": "m"},
|
||||
"rows": [{"가": "a", "높이": [1, 2], "율": 1, "폭": [20, 45]}],
|
||||
}
|
||||
plan = run([{"op": "plan", "info": table, "roles": {"cond": ["가"], "out": ["율"]}}])[0]["plan"]
|
||||
assert [c["header"] for c in plan["cols"]] == [
|
||||
"가",
|
||||
"높이·아래",
|
||||
"높이·위",
|
||||
"율",
|
||||
"폭·아래",
|
||||
"폭·위",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user