Coupple regressions fixed.

This commit is contained in:
Storm Dragon committed 2026-10-10 01:02:34 -04:00
1 parent 39b7488aea
commit 9aad6748e0
7 files changed
+54 -5

No files matched your search

+9 -2
View File
@@ -105,6 +105,10 @@ with tempfile.TemporaryDirectory(prefix="wine-access-menus-") as temporary:
elif event[1] == "text":
assert event[0] == focused, f"text sent without establishing focus: {event!r}"
if args.fixture == "notepad":
dialogEvents = [e for e in events if e[2] in ("Yes", "No", "Cancel")]
for event in dialogEvents:
print("Save dialog:", event[:7])
assert [e[2] for e in dialogEvents if e[1] == "focus"] == ["Yes", "No", "Cancel", "No"], "save dialog focus order changed"
text_events = [e for e in events if e[0].endswith(":text")]
spoken = [e[2] for e in text_events]
for expected in ("e", "l", "beta", "Notepad second line", "N selected",
@@ -120,7 +124,7 @@ with tempfile.TemporaryDirectory(prefix="wine-access-menus-") as temporary:
print(event[2:7])
spoken = [e[2] for e in text_events]
for expected in ("l", "beta", "second line", "s selected", "e selected",
"e unselected", "s unselected", "s deleted", "e deleted",
"e unselected", "s unselected", "s deleted", "e",
"alpha selected", "alpha deleted", "😀"):
assert expected in spoken, f"missing editor feedback: {expected!r}"
assert any(e[3] == "edit" and e[4] == "alpha beta" for e in text_events), "initial line missing"
@@ -131,7 +135,10 @@ with tempfile.TemporaryDirectory(prefix="wine-access-menus-") as temporary:
assert "hello deleted" not in spoken, "replacement misreported as deletion"
assert sum(e[1] == "text" and e[2] == "l" for e in text_events) == 3, "rapid repeated letters lost"
assert any(e[3] == "edit" and e[4] == "menu return line" for e in text_events), "menu return lost caret line"
assert spoken.count("new line deleted") == 2, "CRLF deletion feedback missing"
assert any(e[1] == "text" and e[2] == "e" and "kind=7" in e[5] for e in text_events), "Backspace did not report only the removed character"
assert "e deleted" not in spoken, "Backspace retained the deletion suffix"
assert sum(e[2] == "new line" and "kind=7" in e[5] for e in text_events) == 1, "CRLF Backspace feedback missing"
assert sum(e[2] == "new line deleted" and "kind=4" in e[5] for e in text_events) == 1, "CRLF Delete feedback missing"
assert any(e[4] == "x" * 1022 for e in text_events), "truncated surrogate discarded line"
assert "d" in spoken and "undo restored" in spoken, "Undo left stale text snapshot"
print("PASS: editor focus, characters, words, lines, selection, deletion, Unicode, passwords, and read-only controls")