fix(est-test): reject duplicate JDL tables

This commit is contained in:
2026-11-10 06:40:12 +09:00
parent 5520e3c575
commit 32043f3c01
4 changed files with 27 additions and 1 deletions
+14
View File
@@ -181,3 +181,17 @@ def test_jdl_estimate_preserves_components_when_total_matches():
)
assert result["GC"] == 0
assert result["NC"] == 20
def test_jdl_rejects_case_insensitive_duplicate_tables():
project = json.loads((ROOT / "tools/est-test/sample.json").read_text(encoding="utf-8"))
script = """const fs=require('fs'),j=require('./tools/est-test/jdl.cjs'),a=require('./tools/est-test/archive.cjs');
const p=JSON.parse(fs.readFileSync(0,'utf8'));
const files=new Map([['Global.ini',Buffer.from('[BASIC]')],['Main.txt',Buffer.from('0\\tfirst\\t02\\x05\\r\\n')],
['MAIN.TXT',Buffer.from('0\\tsecond\\t02\\x05\\r\\n')]]);
try { j.read(a.pack(files),p); process.stdout.write('accepted'); }
catch(error) { process.stdout.write(error.message); }"""
result = subprocess.check_output(
["node", "-e", script], input=json.dumps(project).encode(), cwd=ROOT, text=False
).decode("utf-8")
assert "중복" in result