1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00

tests/functional: Add regression test for broken :sh in repl

Can't really test `:u` because it needs <nixpkgs>.
This commit is contained in:
Sergei Zimmerman 2025-03-23 22:13:40 +00:00
parent 44055dc09d
commit d371aadb2b
No known key found for this signature in database
GPG key ID: A9B0B557CA632325

View file

@ -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"
}