Skip to content

Commit 9b59645

Browse files
committed
Let the workspace layout test's Lua assertions fail the suite
Lua 5.5's standalone interpreter exits 0 when the script that raised the error came in on stdin, and exits 1 for the same error in a script file. The block here was piped in through a heredoc, so every assertion in it reported as passing however wrong the value was: changing the expected layout to one the toggle never writes still left the file green.
1 parent 9301092 commit 9b59645

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

test/shell.d/hyprland-workspace-layout-test.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ fi
5050
fail "workspace layout toggle does not persist a rule without a workspace id"
5151
pass "workspace layout toggle ignores broken hyprctl output"
5252

53-
HOME="$home_dir" OMARCHY_PATH="$ROOT" lua <<'LUA'
53+
lua_script="$tmpdir/workspace-layouts.lua"
54+
55+
cat >"$lua_script" <<'LUA'
5456
local rules = {}
5557
5658
hl = {
@@ -66,4 +68,10 @@ assert(#rules == 1)
6668
assert(rules[1].workspace == "3")
6769
assert(rules[1].layout == "scrolling")
6870
LUA
71+
72+
# Lua 5.5 exits 0 when a script that failed came in on stdin, so a heredoc piped
73+
# straight into lua reports every assertion above as passing. Run it as a file.
74+
if ! HOME="$home_dir" OMARCHY_PATH="$ROOT" lua "$lua_script"; then
75+
fail "saved workspace layouts load into Hyprland configuration"
76+
fi
6977
pass "saved workspace layouts load into Hyprland configuration"

0 commit comments

Comments
 (0)