From 6583af9ae6ee8adf9cd810b39fd15a32c10953d2 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 10:30:19 -1000 Subject: Check the log line for lexers that are not found Every check set CGIT_SCINTILLUA_PATH, which the filter takes as given, so the line for a server with no Scintillua at all never ran and deleting it passed. The harness can now clear a variable and hide the directories the filter probes. A lexer.lua anywhere on LUA_PATH also loaded in place of the missing one, so the fallback runs now keep every Lua module out of reach. --- tests/extensions/harness.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/extensions/harness.lua') diff --git a/tests/extensions/harness.lua b/tests/extensions/harness.lua index 1e2fe08..78e491e 100644 --- a/tests/extensions/harness.lua +++ b/tests/extensions/harness.lua @@ -160,6 +160,25 @@ function harness.redirect_file(from, to) path_map[from] = to end +-- Set or clear an environment variable as a script sees it, for a check +-- that needs the environment to differ from the one the shell gave this +-- run. A variable set to nil reads as unset. +local env_map = nil + +function harness.setenv(name, value) + if env_map == nil then + env_map = {} + local real_getenv = os.getenv + os.getenv = function(key) + if env_map[key] == nil then + return real_getenv(key) + end + return env_map[key] or nil + end + end + env_map[name] = value or false +end + -- Deterministic bytes standing in for a digest, built from djb2 style lanes -- in plain arithmetic so they compute the same on every Lua version. Not -- cryptographic, just stable and collision-shy enough for the checks. -- cgit 2.12.1