"""748-2 지킴 — 텍스트 수식 한 줄을 변수 이름 · 값 하나하나로 나눔(누르면 줄 모달).""" from __future__ import annotations import json import subprocess from pathlib import Path HERE = Path(__file__).resolve().parent def test_변수_이름_값_조각(): proc = subprocess.run( # noqa: S603 — 고정 실행 파일 ["node", str(HERE / "helper_748_2_formula_tokens.cjs")], capture_output=True, text=True, encoding="utf-8", timeout=60, ) assert proc.returncode == 0, proc.stderr out = json.loads(proc.stdout) # 이름식 — 변수 이름(점 든 표 찾기 이름 포함)만 · 수 · 기호는 아님 assert out["nameHot"] == [ "굴착기노무비단가", "뒤채움및다짐소형장비.굴착기", "시공량", "굴착기노무비", ] assert "8" in out["nameAll"] and "=" in out["nameAll"] # 함수 이름(「이름(」)은 변수가 아님 · 수 · 홀로 선 빼기는 아님 assert out["fnCall"] == ["단가", "보정"] # 값식 — 수 하나하나(콤마 · 소수점 포함) · 기호는 그대로 assert out["valueHot"] == ["35,412", "1", "8", "110", "2,575"] assert out["valueAll"][:3] == ["13,873", "=", "13,873"] assert out["empty"] == [0, 0]