mirror of
https://github.com/NixOS/nix
synced 2025-07-08 11:03:54 +02:00
Merge branch 'master' into make
Conflicts: src/libexpr/eval.cc
This commit is contained in:
commit
81628a6ccc
34 changed files with 473 additions and 103 deletions
|
@ -40,6 +40,31 @@ nix-store --check-validity $outPath
|
|||
nix-store -qR $outPath | grep input-2
|
||||
|
||||
|
||||
# Test whether Nix notices if the NAR doesn't match the hash in the NAR info.
|
||||
clearStore
|
||||
|
||||
nar=$(ls $cacheDir/*.nar.xz | head -n1)
|
||||
mv $nar $nar.good
|
||||
mkdir -p $TEST_ROOT/empty
|
||||
nix-store --dump $TEST_ROOT/empty | xz > $nar
|
||||
|
||||
nix-build --option binary-caches "file://$cacheDir" dependencies.nix -o $TEST_ROOT/result 2>&1 | tee $TEST_ROOT/log
|
||||
grep -q "hash mismatch in downloaded path" $TEST_ROOT/log
|
||||
|
||||
mv $nar.good $nar
|
||||
|
||||
|
||||
# Test whether this unsigned cache is rejected if the user requires signed caches.
|
||||
clearStore
|
||||
|
||||
rm -f $NIX_STATE_DIR/binary-cache*
|
||||
|
||||
if nix-store --option binary-caches "file://$cacheDir" --option signed-binary-caches '*' -r $outPath; then
|
||||
echo "unsigned binary cache incorrectly accepted"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Test whether fallback works if we have cached info but the
|
||||
# corresponding NAR has disappeared.
|
||||
clearStore
|
||||
|
|
1
tests/lang/eval-okay-dynamic-attrs-2.exp
Normal file
1
tests/lang/eval-okay-dynamic-attrs-2.exp
Normal file
|
@ -0,0 +1 @@
|
|||
true
|
1
tests/lang/eval-okay-dynamic-attrs-2.nix
Normal file
1
tests/lang/eval-okay-dynamic-attrs-2.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ a."${"b"}" = true; a."${"c"}" = false; }.a.b
|
1
tests/lang/eval-okay-dynamic-attrs-bare.exp
Normal file
1
tests/lang/eval-okay-dynamic-attrs-bare.exp
Normal file
|
@ -0,0 +1 @@
|
|||
{ binds = true; hasAttrs = true; multiAttrs = true; recBinds = true; selectAttrs = true; selectOrAttrs = true; }
|
17
tests/lang/eval-okay-dynamic-attrs-bare.nix
Normal file
17
tests/lang/eval-okay-dynamic-attrs-bare.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
let
|
||||
aString = "a";
|
||||
|
||||
bString = "b";
|
||||
in {
|
||||
hasAttrs = { a.b = null; } ? ${aString}.b;
|
||||
|
||||
selectAttrs = { a.b = true; }.a.${bString};
|
||||
|
||||
selectOrAttrs = { }.${aString} or true;
|
||||
|
||||
binds = { ${aString}."${bString}c" = true; }.a.bc;
|
||||
|
||||
recBinds = rec { ${bString} = a; a = true; }.b;
|
||||
|
||||
multiAttrs = { ${aString} = true; ${bString} = false; }.a;
|
||||
}
|
1
tests/lang/eval-okay-dynamic-attrs.exp
Normal file
1
tests/lang/eval-okay-dynamic-attrs.exp
Normal file
|
@ -0,0 +1 @@
|
|||
{ binds = true; hasAttrs = true; multiAttrs = true; recBinds = true; selectAttrs = true; selectOrAttrs = true; }
|
17
tests/lang/eval-okay-dynamic-attrs.nix
Normal file
17
tests/lang/eval-okay-dynamic-attrs.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
let
|
||||
aString = "a";
|
||||
|
||||
bString = "b";
|
||||
in {
|
||||
hasAttrs = { a.b = null; } ? "${aString}".b;
|
||||
|
||||
selectAttrs = { a.b = true; }.a."${bString}";
|
||||
|
||||
selectOrAttrs = { }."${aString}" or true;
|
||||
|
||||
binds = { "${aString}"."${bString}c" = true; }.a.bc;
|
||||
|
||||
recBinds = rec { "${bString}" = a; a = true; }.b;
|
||||
|
||||
multiAttrs = { "${aString}" = true; "${bString}" = false; }.a;
|
||||
}
|
1
tests/lang/eval-okay-redefine-builtin.exp
Normal file
1
tests/lang/eval-okay-redefine-builtin.exp
Normal file
|
@ -0,0 +1 @@
|
|||
false
|
3
tests/lang/eval-okay-redefine-builtin.nix
Normal file
3
tests/lang/eval-okay-redefine-builtin.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
let
|
||||
throw = abort "Error!";
|
||||
in (builtins.tryEval <foobaz>).success
|
Loading…
Add table
Add a link
Reference in a new issue