checks(unit): xkbcommon in the suite's env, and the two-warp acquire

Two gaps found by running more than the gate command.

`checks/unit.nix` builds its own `python3.withPackages` and had only
pytest and pywayland in it, so `nix build .#checks.unit` would have
collected tests/pointer/test_keymap.py and failed on the import. The
dev shell has xkbcommon through nix/package.nix and the gate command
therefore never noticed. It is not an optional dependency: that file
compiles a real `us` keymap and a real `de` one, because only xkbcommon
can say `é` is unmappable on `us` and that `@` on `de` needs a
level-three mask.

And two integration tests asserted acquire's single warp, which is now
two. They are the whole-gesture trace and the bookmark-survives-a-
restart case, and both now assert the pair -- with the restored
position as the SECOND warp, since the bookmark is where the cursor is
left and the reverse order would restore every session a few pixels
off.

  nix develop -c python -m pytest tests -q
  905 passed in 65.91s

  nix build --no-link .#checks.x86_64-linux.unit
  903 passed, 2 skipped in 73.24s
  unit suite: 905 collected, 903 executed, 0 failed, 0 errored, 2 skipped

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GhNPM6rGcuzxocM1nATnuM
This commit is contained in:
HermenixandClaude Opus 5 committed 2026-10-04 04:16:46 +00:00
1 parent e6f4c3bb3f
commit 7890315cf6
2 files changed
+18 -2

No files matched your search

+7 -1
View File
@@ -18,7 +18,13 @@
hhstream,
}:
let
pytestEnv = python3.withPackages (ps: [ ps.pytest ps.pywayland ]);
# `xkbcommon` beside `pywayland`, and it is not optional: `tests/pointer/
# test_keymap.py` compiles a real `us` keymap and a real `de` one, because
# only xkbcommon can say that `é` is unmappable on `us` and that `@` on `de`
# needs a level-three mask rather than Shift. A suite that could skip those
# would let the unmappable-character path rot, which is the path that decides
# whether a bad string types a prefix.
pytestEnv = python3.withPackages (ps: [ ps.pytest ps.pywayland ps.xkbcommon ]);
# Only the suite itself, so an editor's droppings or a local .pytest_cache
# cannot change the derivation's hash.
+11 -1
View File
@@ -450,6 +450,11 @@ def test_a_whole_gesture_runs_through_the_broker_and_the_driver(rig: Rig):
assert released["buttons_lifted"] == []
assert rig.driver.sink.calls == [
# Acquire is TWO warps: one warp onto an idle cursor moves the cursor
# and not keyboard focus, so acquire nudges to a neighbouring pixel and
# then lands on the target. The second one is the bookmark.
("warp", output, 0.5, 0.504),
("frame", output),
("warp", output, 0.5, 0.5),
("frame", output),
("warp", output, 0.25, 0.75),
@@ -572,7 +577,12 @@ def test_a_restored_bookmark_survives_a_daemon_restart(short_tmpdir: Path):
acquired = rig.daemon.call("pointer.acquire", id=session_id)
assert (acquired["bookmark"]["x"], acquired["bookmark"]["y"]) == (0.8, 0.2)
assert rig.driver.sink.of("warp") == [("warp", f"hh-{session_id}", 0.8, 0.2)]
# The nudge, then the restored position: the bookmark has to be the
# *second* warp, or every restore would be a few pixels off.
assert rig.driver.sink.of("warp") == [
("warp", f"hh-{session_id}", 0.8, 0.204),
("warp", f"hh-{session_id}", 0.8, 0.2),
]
finally:
_kill_everything(rig.daemon)
rig.stop()