mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
parent
a8e600e386
commit
a75b082a28
12 changed files with 159 additions and 163 deletions
|
@ -35,13 +35,13 @@ nix-instantiate --eval -E 'assert 1 + 2 == 3; true'
|
|||
[[ "$(nix-instantiate --eval -E '{"assert"=1;bar=2;}')" == '{ "assert" = 1; bar = 2; }' ]]
|
||||
|
||||
# Check that symlink cycles don't cause a hang.
|
||||
ln -sfn cycle.nix $TEST_ROOT/cycle.nix
|
||||
(! nix eval --file $TEST_ROOT/cycle.nix)
|
||||
ln -sfn cycle.nix "$TEST_ROOT/cycle.nix"
|
||||
(! nix eval --file "$TEST_ROOT/cycle.nix")
|
||||
|
||||
# Check that relative symlinks are resolved correctly.
|
||||
mkdir -p $TEST_ROOT/xyzzy $TEST_ROOT/foo
|
||||
ln -sfn ../xyzzy $TEST_ROOT/foo/bar
|
||||
printf 123 > $TEST_ROOT/xyzzy/default.nix
|
||||
mkdir -p "$TEST_ROOT/xyzzy" "$TEST_ROOT/foo"
|
||||
ln -sfn ../xyzzy "$TEST_ROOT/foo/bar"
|
||||
printf 123 > "$TEST_ROOT/xyzzy/default.nix"
|
||||
[[ $(nix eval --impure --expr "import $TEST_ROOT/foo/bar") = 123 ]]
|
||||
|
||||
# Test --arg-from-file.
|
||||
|
@ -57,7 +57,7 @@ fi
|
|||
|
||||
# Test that unknown settings are warned about
|
||||
out="$(expectStderr 0 nix eval --option foobar baz --expr '""' --raw)"
|
||||
[[ "$(echo "$out" | grep foobar | wc -l)" = 1 ]]
|
||||
[[ "$(echo "$out" | grep -c foobar)" = 1 ]]
|
||||
|
||||
# Test flag alias
|
||||
out="$(nix eval --expr '{}' --build-cores 1)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue