From a3e99602c0732e149513746a96ed43ce736a3287 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 16 Feb 2026 21:06:41 +0100 Subject: [PATCH] fix(tests): use glob instead of regex in nix-shell test The NIX_BUILD_TOP test used regex matching with an unquoted path variable. When the path contains `+` (or other regex operators), the test fails because `+` is interpreted as a quantifier rather than a literal character. Glob matching handles these characters correctly. --- tests/functional/nix-shell.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/nix-shell.sh b/tests/functional/nix-shell.sh index 3343d6195..263679347 100755 --- a/tests/functional/nix-shell.sh +++ b/tests/functional/nix-shell.sh @@ -39,8 +39,8 @@ testTmpDir=$(pwd)/nix-shell mkdir -p "$testTmpDir" # shellcheck disable=SC2016 output=$(TMPDIR="$testTmpDir" nix-shell --pure "$shellDotNix" -A shellDrv --run 'echo $NIX_BUILD_TOP') -[[ "$output" =~ ${testTmpDir}.* ]] || { - echo "expected $output =~ ${testTmpDir}.*" >&2 +[[ "$output" == "${testTmpDir}"/* ]] || { + echo "expected $output == ${testTmpDir}/*" >&2 exit 1 }