diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lang.sh | 6 | ||||
-rw-r--r-- | tests/lang/eval-okay-autoargs.exp | 1 | ||||
-rw-r--r-- | tests/lang/eval-okay-autoargs.flags | 1 | ||||
-rw-r--r-- | tests/lang/eval-okay-autoargs.nix | 15 |
4 files changed, 22 insertions, 1 deletions
diff --git a/tests/lang.sh b/tests/lang.sh index 851d89136c56..18eb0278cfcc 100644 --- a/tests/lang.sh +++ b/tests/lang.sh @@ -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 diff --git a/tests/lang/eval-okay-autoargs.exp b/tests/lang/eval-okay-autoargs.exp new file mode 100644 index 000000000000..3b12bdd5e596 --- /dev/null +++ b/tests/lang/eval-okay-autoargs.exp @@ -0,0 +1 @@ +Str("xyzzy!xyzzy!foobar",[]) diff --git a/tests/lang/eval-okay-autoargs.flags b/tests/lang/eval-okay-autoargs.flags new file mode 100644 index 000000000000..ae3762254460 --- /dev/null +++ b/tests/lang/eval-okay-autoargs.flags @@ -0,0 +1 @@ +--arg lib import(lang/lib.nix) --argstr xyzzy xyzzy! -A result diff --git a/tests/lang/eval-okay-autoargs.nix b/tests/lang/eval-okay-autoargs.nix new file mode 100644 index 000000000000..1356bb5aa21f --- /dev/null +++ b/tests/lang/eval-okay-autoargs.nix @@ -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]; +} |