test(458 덧 2 시험 헬퍼): 307 헬퍼 로더가 .js 끝을 걷고 .ts 로 찾음 · test_b06_save_recompute 의 saveDesign 본문 창 4000 자로 넓힘
This commit is contained in:
@@ -17,7 +17,8 @@ const load = (file) => {
|
||||
const near = (m) => {
|
||||
if (m.startsWith("@config/")) return load(path.join(ROOT, "config", `${m.slice(8)}.ts`));
|
||||
if (m.endsWith(".json")) return require(path.join(path.dirname(file), m));
|
||||
if (m.startsWith(".")) return load(path.join(path.dirname(file), `${m}.ts`));
|
||||
if (m.startsWith("."))
|
||||
return load(path.join(path.dirname(file), `${m.replace(/\.js$/, "")}.ts`));
|
||||
return new Proxy({}, { get: () => () => {} });
|
||||
};
|
||||
new Function("exports", "module", "require", js)(box.exports, box, near);
|
||||
|
||||
@@ -23,9 +23,9 @@ SHARED = ROOT / "A00_Common" / "design" / "design_shared.ts"
|
||||
SAVE = ROOT / "A00_Common" / "design" / "design_save.ts"
|
||||
|
||||
|
||||
def _body(source: str, marker: str) -> str:
|
||||
def _body(source: str, marker: str, size: int = 1200) -> str:
|
||||
start = source.index(marker)
|
||||
return source[start : start + 1200]
|
||||
return source[start : start + size]
|
||||
|
||||
|
||||
def test_저장이_면적을_모으기_전에_다시_계산한다() -> None:
|
||||
@@ -36,7 +36,7 @@ def test_저장이_면적을_모으기_전에_다시_계산한다() -> None:
|
||||
shared = _body(SHARED.read_text(encoding="utf-8"), "export async function saveSharedDesign")
|
||||
assert "prepare: crossSave?.prepare" in shared, "한 벌이 재계산을 저장 한 줄기에 안 넘긴다"
|
||||
save = SAVE.read_text(encoding="utf-8")
|
||||
run = _body(save, "export async function saveDesign")
|
||||
run = _body(save, "export async function saveDesign", 4000)
|
||||
assert run.index("ctx.prepare?.()") < run.index("ctx.cross(confirm)"), (
|
||||
"저장 한 줄기가 재계산보다 면적 수집을 먼저 부른다 — 옛 면적이 실린다"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user