From 20ce98f87bf7e09724880e171bbf90ca8e44bcf3 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Sun, 23 Mar 2025 22:13:40 +0000 Subject: [PATCH] tests/functional: Add regression test for broken `:sh` in repl Can't really test `:u` because it needs . (cherry picked from commit d371aadb2b6587572ce84f3899c19ae9d14eb435) --- tests/functional/repl.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/functional/repl.sh b/tests/functional/repl.sh index 59d1f1be0..5d99fbb02 100755 --- a/tests/functional/repl.sh +++ b/tests/functional/repl.sh @@ -56,6 +56,10 @@ testRepl () { nix repl "${nixArgs[@]}" 2>&1 <<< "builtins.currentSystem" \ | grep "$(nix-instantiate --eval -E 'builtins.currentSystem')" + # regression test for #12163 + replOutput=$(nix repl "${nixArgs[@]}" 2>&1 <<< ":sh import $testDir/simple.nix") + echo "$replOutput" | grepInverse "error: Cannot run 'nix-shell'" + expectStderr 1 nix repl "${testDir}/simple.nix" \ | grepQuiet -s "error: path '$testDir/simple.nix' is not a flake" }