mirror of
https://github.com/NixOS/nix
synced 2025-07-08 19:23:54 +02:00
* Option --argstr for passing string arguments easily. (NIX-75)
This commit is contained in:
parent
4e329f173f
commit
e418976107
11 changed files with 88 additions and 28 deletions
|
@ -40,7 +40,11 @@ for i in lang/eval-okay-*.nix; do
|
|||
i=$(basename $i .nix)
|
||||
|
||||
if test -e lang/$i.exp; then
|
||||
if ! $nixinstantiate --eval-only lang/$i.nix > lang/$i.out; then
|
||||
flags=
|
||||
if test -e lang/$i.flags; then
|
||||
flags=$(cat lang/$i.flags)
|
||||
fi
|
||||
if ! $nixinstantiate $flags --eval-only lang/$i.nix > lang/$i.out; then
|
||||
echo "FAIL: $i should evaluate"
|
||||
fail=1
|
||||
elif ! $aterm_bin/atdiff lang/$i.out lang/$i.exp; then
|
||||
|
|
1
tests/lang/eval-okay-autoargs.exp
Normal file
1
tests/lang/eval-okay-autoargs.exp
Normal file
|
@ -0,0 +1 @@
|
|||
Str("xyzzy!xyzzy!foobar",[])
|
1
tests/lang/eval-okay-autoargs.flags
Normal file
1
tests/lang/eval-okay-autoargs.flags
Normal file
|
@ -0,0 +1 @@
|
|||
--arg lib import(lang/lib.nix) --argstr xyzzy xyzzy! -A result
|
15
tests/lang/eval-okay-autoargs.nix
Normal file
15
tests/lang/eval-okay-autoargs.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
let
|
||||
|
||||
foobar = "foobar";
|
||||
|
||||
in
|
||||
|
||||
{ xyzzy2 ? xyzzy # mutually recursive args
|
||||
, xyzzy ? "blaat" # will be overriden by --argstr
|
||||
, fb ? foobar
|
||||
, lib # will be set by --arg
|
||||
}:
|
||||
|
||||
{
|
||||
result = lib.concat [xyzzy xyzzy2 fb];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue