diff --git a/scripts/testing/tests/test_desktop.py b/scripts/testing/tests/test_desktop.py index 1538d6a..ca2f266 100644 --- a/scripts/testing/tests/test_desktop.py +++ b/scripts/testing/tests/test_desktop.py @@ -11,6 +11,8 @@ installs `awww` (swww successor) and `pacman -Q swww` no longer matches — so this checks awww. That divergence from the shell sweep is a correctness fix. """ +import re + import pytest @@ -19,8 +21,12 @@ HYPRLAND_TOOLS = [ "awww", "grim", "slurp", "gammastep", "foot", ] +# Note: hyprland.lua sits beside two .conf files on purpose. Only Hyprland's own +# config format is deprecated (removed in 0.57); hypridle and hyprlock are +# separate projects still on hyprlang, so their .conf names are current. Don't +# "fix" this list for consistency -- that reverts the Lua port. HYPRLAND_CONFIGS = [ - ".config/hypr/hyprland.conf", + ".config/hypr/hyprland.lua", ".config/hypr/hypridle.conf", ".config/hypr/hyprlock.conf", ".config/waybar/config", @@ -139,8 +145,19 @@ def test_bt_panel_wired(host, hyprland_installed, home): waybar = host.file("%s/.config/waybar/config" % home) assert "custom/bluetooth" in waybar.content_string, \ "waybar config lacks the custom/bluetooth module" - hyprconf = host.file("%s/.config/hypr/hyprland.conf" % home) - assert "bt-panel" in hyprconf.content_string, \ - "hyprland.conf lacks the bt-panel keybind" + hypr = host.file("%s/.config/hypr/hyprland.lua" % home).content_string + # Assert the dispatcher and the chord, not the bare binary name. "bt-panel" + # on its own still appears inside exec_cmd() when the chord that reaches it + # is mangled, so the weak form passes on a config where Super+Shift+B does + # nothing. That is not hypothetical: converting this config to Lua produced + # exactly that defect elsewhere ("CTRL" .. mod .. " + S" collapsing to an + # unparseable CTRLSUPER + S, which Hyprland rejects at parse and leaves dead). + # One pattern spanning the whole bind, not two independent checks: asserting + # the chord and the dispatcher separately passes when they sit on different + # lines, and a planned reshuffle of the panel keybinding family is exactly + # the change that would separate them. + assert re.search( + r'hl\.bind\(\s*mod\s*\.\.\s*" \+ SHIFT \+ B",\s*hl\.dsp\.exec_cmd\("bt-panel"\)', + hypr), "hyprland.lua lacks the Super+Shift+B bind reaching bt-panel" assert host.file("%s/.config/themes/dupre/panel.css" % home).exists, \ "shared panel css missing from the stowed theme"