Skip to content

Commit

Permalink
Add test case for incidentally fixed NixOS#4228
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Nov 9, 2020
1 parent 7a11828 commit e4e934c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/nix-shell.sh
Expand Up @@ -58,9 +58,13 @@ output=$($TEST_ROOT/shell.shebang.rb abc ruby)

# Test 'nix develop'.
nix develop -f shell.nix shellDrv -c bash -c '[[ -n $stdenv ]]'
# Preserve stdin with `-c`

# Ensure `nix develop -c` preserves stdin
echo foo | nix develop -f shell.nix shellDrv -c cat | grep -q foo

# Ensure `nix develop -c` actually executes the command if stdout isn't a terminal
nix develop -f shell.nix shellDrv -c echo foo |& grep -q foo

# Test 'nix print-dev-env'.
source <(nix print-dev-env -f shell.nix shellDrv)
[[ -n $stdenv ]]

0 comments on commit e4e934c

Please sign in to comment.