Files
Aislo/resources/tester/test_346_4_one_undo.py
T
eomsangdonandClaude Opus 5.5 2e4316567c feat(설정 단축키): CAD 리본 묶음 · 찾기 · 다른 곳 = 실제 동작 등록부 표 · 키 바꾸기 · 겹침 막음 (PLAN 588-1~3 · 요구 445 C2 · C3)
- 새 key_registry.ts — 화면마다 받는 키 · 마우스 동작 한 벌 · keyIs(evt, id) · 바꾼 키만 input-prefs.keys
- ☰ [설정] CAD 탭 = 찾기 칸 + 「키 · 마우스」 + 리본 탭 › 패널 접이 묶음(기타 여섯) · 날 input → 부품 입력
- 다른 곳 탭 = 손글 안내 지우고 등록부 표(B05 방향키 · D03 Delete 등 빠진 것 포함) · 찾기
- 키 기록 칸 · 줄마다 [기본값] · [모두 기본값] · 같은 화면 · 모든 화면 겹침 · 브라우저 몫 · CAD 글자 단독은 저장 막음
- 배선: B05 되돌림 · 자유지정 Enter · Backspace · D03 되돌림 · 그리기 · 지움(한글 자판도 자판 자리) · CAD F3 · F7 · F8 · F10 · Ctrl 명령 · Delete
- 낡은 글 대조 시험 셋(215-1 · 345-3 · 346-4)은 새 배선 글로 고침

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:50:41 +09:00

64 lines
2.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""346-4 되돌리기 한 줄 — 평면 점 옮김 → 계획고 ▲ → 횡단 카드 고침 → Ctrl+Z 세 번이 거꾸로.
./venv/Scripts/python.exe -m pytest resources/tester/test_346_4_one_undo.py -q
사진 크기(300 KB 칸 셋 × 100단 heap)는 `test_346_4_profile_history.py`.
"""
from __future__ import annotations
import json
import subprocess
from pathlib import Path
import pytest
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[1]
@pytest.fixture(scope="module")
def out() -> dict:
run = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", str(HERE / "helper_346_4_one_undo.cjs")],
capture_output=True,
text=True,
encoding="utf-8",
)
assert run.returncode == 0, run.stderr
return json.loads(run.stdout)
def test_끄는_중간은_안_찍고_놓을_때_한_걸음(out) -> None:
assert out["start"]["undo"] is False
assert out["heldUndo"] is False
edited = out["afterEdits"]
assert edited["route"] == 70 and edited["grade"] and edited["cross"] and edited["undo"]
def test_Ctrl_Z_세_번이_거꾸로(out) -> None:
u1, u2, u3 = out["undo1"], out["undo2"], out["undo3"]
assert u1["cross"] is None and u1["grade"] and u1["route"] == 70 # 횡단부터
assert u2["grade"] is None and u2["route"] == 70 # 그다음 계획고
assert out["editorBeforeRouteUndo"] == 0 # 노선이 그대로인 걸음은 편집기를 안 건드림
assert u3["route"] is None and u3["undo"] is False and u3["redo"] # 마지막 평면 · 열 때로
assert out["editorAfterUndo"] == [[50, False, "tag-open", "되돌렸습니다."]]
def test_다시하기는_앞으로(out) -> None:
assert out["redo1"]["route"] == 70 and out["redo1"]["grade"] is None
r3 = out["redo3"]
assert r3["route"] == 70 and r3["grade"] and r3["cross"] and r3["redo"] is False
# 옮긴 걸음의 고정 · 추천 꼬리표까지 되살림(같은 선의 옛 걸음)
assert out["editorAfterRedo"] == [[70, True, "tag-moved", "다시 했습니다."]]
assert out["profileReads"] == 6 # 종단도도 걸음마다 다시 읽음
def test_단축키는_사진첩_한_곳():
tools = (ROOT / "B05_Profile/B05_Profile_UI_Profile_Panel_Tools.ts").read_text(encoding="utf-8")
assert "undoOwner" not in tools
assert 'keyIs(event, "b05.redo")' in tools and "setPageHistory(history)" in tools # 588-3
plan = (ROOT / "B05_Profile/B05_Profile_UI_RouteEdit_History.ts").read_text(encoding="utf-8")
assert '"keydown"' not in plan
assert not (ROOT / "B05_Profile/B05_Profile_UI_RouteEdit_UndoOwner.ts").exists()