mirror of
https://github.com/NixOS/nix
synced 2025-07-07 18:31:49 +02:00
Merge branch 'dynamic-attrs-no-sugar' of github.com:shlevy/nix
This commit is contained in:
commit
7a61c88dbb
10 changed files with 249 additions and 63 deletions
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.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