Skip to content

Commit

Permalink
Fix language tests a bit
Browse files Browse the repository at this point in the history
- Remove some stray saved error messages that didn't correspond to any
  test, because they were renamed in
  d11faa0.

- Need `--eval` in test failure test in order to get in "read-only" mode
  where we don't try to write to the store. (The other tests already do
  this.)

- Need `--strict` so top-level attribute sets are still forced, like
  they are without `--eval`.
  • Loading branch information
Ericson2314 committed Oct 16, 2023
1 parent 5442d9b commit f7a36f9
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 27 deletions.
2 changes: 1 addition & 1 deletion tests/functional/lang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ for i in lang/eval-fail-*.nix; do
echo "evaluating $i (should fail)";
i=$(basename "$i" .nix)
if
expectStderr 1 nix-instantiate --show-trace "lang/$i.nix" \
expectStderr 1 nix-instantiate --eval --strict --show-trace "lang/$i.nix" \
| sed "s!$(pwd)!/pwd!g" > "lang/$i.err"
then
diffAndAccept "$i" err err.exp
Expand Down
1 change: 0 additions & 1 deletion tests/functional/lang/eval-fail-antiquoted-path.err.exp

This file was deleted.

10 changes: 0 additions & 10 deletions tests/functional/lang/eval-fail-bad-antiquote-1.err.exp

This file was deleted.

1 change: 0 additions & 1 deletion tests/functional/lang/eval-fail-bad-antiquote-2.err.exp

This file was deleted.

10 changes: 0 additions & 10 deletions tests/functional/lang/eval-fail-bad-antiquote-3.err.exp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
error: operation 'addToStoreFromDump' is not supported by store 'dummy'
error: getting status of '/pwd/lang/fnord': No such file or directory
12 changes: 11 additions & 1 deletion tests/functional/lang/eval-fail-dup-dynamic-attrs.err.exp
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
error: dynamic attribute 'b' already defined at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:2:11
error:
… while evaluating the attribute 'set'

at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:2:3:

1| {
2| set = { "${"" + "b"}" = 1; };
| ^
3| set = { "${"b" + ""}" = 2; };

error: dynamic attribute 'b' already defined at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:2:11

at /pwd/lang/eval-fail-dup-dynamic-attrs.nix:3:11:

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/lang/eval-fail-nonexist-path.err.exp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
error: operation 'addToStoreFromDump' is not supported by store 'dummy'
error: getting status of '/pwd/lang/fnord': No such file or directory
1 change: 0 additions & 1 deletion tests/functional/lang/parse-fail-dup-attrs-6.err.exp

This file was deleted.

0 comments on commit f7a36f9

Please sign in to comment.