"""환경설정 전체: 읽기 기본값·바뀐 칸만 쓰기·옵션 자리(계산·표시·기성·Env).""" from test_est_rea_parity import run def test_write_only_changed_fields_to_their_places(): result = run( "math", """(()=>{ const A=EstOptionAll, item=(k)=>A.TABS.flatMap(t=>t[1]).find(i=>i.k===k); const o={HeadDigits:2,VerFormat:true,CostValueTrunc:false,AutoCalc:true}; const r0={head:A.read(o,item('headDigits')),fmt:A.read(o,item('format')),code:A.read(o,item('code')), total:A.read(o,item('totalName'))}; A.write(o,{headDigits:1,format:1,code:true,level:true,jabbi:true,costMethod:1,recalc:2,twoLine:1}); return {r0,o}; })()""", ) assert result["r0"] == {"head": 1, "fmt": 0, "code": False, "total": "순공사비"} o = result["o"] assert o["HeadDigits"] == 2 # 1 → 1 그대로(바뀌지 않음) assert o["VerFormat"] is False assert o["CostValueTrunc"] is True assert o["OldRecalcMethod"] == 2 assert o["Display"] == {"code": True, "twoLine": True} assert o["AccomOption"] == {"level": True} assert o["Env"] == {"jabbi": True}