aboutsummaryrefslogtreecommitdiff
path: root/tests/functional
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/shell-hello.nix16
-rw-r--r--tests/functional/shell.sh8
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/functional/shell-hello.nix b/tests/functional/shell-hello.nix
index 3fdd3501d..dfe66ef93 100644
--- a/tests/functional/shell-hello.nix
+++ b/tests/functional/shell-hello.nix
@@ -23,4 +23,20 @@ with import ./config.nix;
chmod +x $dev/bin/hello2
'';
};
+
+ salve-mundi = mkDerivation {
+ name = "salve-mundi";
+ outputs = [ "out" ];
+ meta.outputsToInstall = [ "out" ];
+ buildCommand =
+ ''
+ mkdir -p $out/bin
+
+ cat > $out/bin/hello <<EOF
+ #! ${shell}
+ echo "Salve Mundi from $out/bin/hello"
+ EOF
+ chmod +x $out/bin/hello
+ '';
+ };
}
diff --git a/tests/functional/shell.sh b/tests/functional/shell.sh
index d2f7cf14e..8bbeabedf 100644
--- a/tests/functional/shell.sh
+++ b/tests/functional/shell.sh
@@ -10,6 +10,14 @@ nix shell -f shell-hello.nix hello -c hello NixOS | grep 'Hello NixOS'
nix shell -f shell-hello.nix hello^dev -c hello2 | grep 'Hello2'
nix shell -f shell-hello.nix 'hello^*' -c hello2 | grep 'Hello2'
+
+if isDaemonNewer "2.20.0pre20231220"; then
+ # Test that command line attribute ordering is reflected in the PATH
+ # https://github.com/NixOS/nix/issues/7905
+ nix shell -f shell-hello.nix hello salve-mundi -c hello | grep 'Hello World'
+ nix shell -f shell-hello.nix salve-mundi hello -c hello | grep 'Salve Mundi'
+fi
+
requireSandboxSupport
chmod -R u+w $TEST_ROOT/store0 || true