diff --git a/checks/unit.nix b/checks/unit.nix index de0ac15..4a29301 100644 --- a/checks/unit.nix +++ b/checks/unit.nix @@ -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. diff --git a/tests/sessions/integration/test_containers.py b/tests/sessions/integration/test_containers.py index 4ebd79f..25e224a 100644 --- a/tests/sessions/integration/test_containers.py +++ b/tests/sessions/integration/test_containers.py @@ -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()