Fix config/prompt tests to use config.lua extension

The tests wrote config as `lush/config` (no extension) but
handle_lushconfig() looks for `config.lua` or `config.lush`.
This commit is contained in:
Cormac Shannon
2026-03-18 09:54:18 +00:00
parent 768de9fe8b
commit 02df45b18f
2 changed files with 5 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ end
do
local tmpdir = tmpbase .. "_t1"
mkdir(tmpdir .. "/lush")
writefile(tmpdir .. "/lush/config", '_LUSH_TEST_MARKER = 42\n')
writefile(tmpdir .. "/lush/config.lua", '_LUSH_TEST_MARKER = 42\n')
local out = run_with_config(tmpdir, "print(_LUSH_TEST_MARKER)")
assert(out:find("42"), "config file should set global: " .. out)
@@ -79,7 +79,7 @@ end
do
local tmpdir = tmpbase .. "_t3"
mkdir(tmpdir .. "/lush/config.d")
writefile(tmpdir .. "/lush/config", '_LUSH_SEQ = "M"\n')
writefile(tmpdir .. "/lush/config.lua", '_LUSH_SEQ = "M"\n')
writefile(tmpdir .. "/lush/config.d/01.lua",
'_LUSH_SEQ = _LUSH_SEQ .. "D"\n')
@@ -94,7 +94,7 @@ end
do
local tmpdir = tmpbase .. "_t4"
mkdir(tmpdir .. "/lush")
writefile(tmpdir .. "/lush/config", '_LUSH_SUPPRESSED = true\n')
writefile(tmpdir .. "/lush/config.lua", '_LUSH_SUPPRESSED = true\n')
local out = run_with_config_E(tmpdir, "print(_LUSH_SUPPRESSED)")
assert(out:find("nil"), "-E should suppress config: " .. out)
@@ -139,7 +139,7 @@ end
do
local tmpdir = tmpbase .. "_t7"
mkdir(tmpdir .. "/lush")
writefile(tmpdir .. "/lush/config", 'error("config boom")\n')
writefile(tmpdir .. "/lush/config.lua", 'error("config boom")\n')
local out = run_with_config(tmpdir, "print(99)")
assert(out:find("99"), "config error should be non-fatal: " .. out)

View File

@@ -26,7 +26,7 @@ local function run_lua(input, config_content)
local tmpdir = tmpbase .. "_run"
mkdir(tmpdir .. "/lush")
if config_content then
writefile(tmpdir .. "/lush/config", config_content)
writefile(tmpdir .. "/lush/config.lua", config_content)
end
local cmd = string.format(
'printf "%%s\\n" %s | XDG_CONFIG_HOME="%s" ./lua -i 2>&1',