about summary refs log tree commit diff
path: root/tests/nix-shell.sh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-11-24T17·07+0100
committerEelco Dolstra <edolstra@gmail.com>2017-11-24T17·08+0100
commit90948a4e3a64492b7d117d93657221fa7b598e6e (patch)
treed339dad0dd12db1132d3484a6cad199c13a78b82 /tests/nix-shell.sh
parent0fc3e581e0585e377d4b42e343b0487606add547 (diff)
nix-shell/nix-build: Support .drv files again
Fixes #1663.

Also handle '!<output-name>' (#1694).
Diffstat (limited to 'tests/nix-shell.sh')
-rw-r--r--tests/nix-shell.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/nix-shell.sh b/tests/nix-shell.sh
index f0f34a5f8705..f7cac6ecf8ef 100644
--- a/tests/nix-shell.sh
+++ b/tests/nix-shell.sh
@@ -10,6 +10,13 @@ output=$(nix-shell --pure shell.nix -A shellDrv --run \
 
 [ "$output" = " - foo - bar" ]
 
+# Test nix-shell on a .drv
+[[ $(nix-shell --pure $(nix-instantiate shell.nix -A shellDrv) --run \
+    'echo "$IMPURE_VAR - $VAR_FROM_STDENV_SETUP - $VAR_FROM_NIX"') = " - foo - bar" ]]
+
+[[ $(nix-shell --pure $(nix-instantiate shell.nix -A shellDrv) --run \
+    'echo "$IMPURE_VAR - $VAR_FROM_STDENV_SETUP - $VAR_FROM_NIX"') = " - foo - bar" ]]
+
 # Test nix-shell -p
 output=$(NIX_PATH=nixpkgs=shell.nix nix-shell --pure -p foo bar --run 'echo "$(foo) $(bar)"')
 [ "$output" = "foo bar" ]