tests/functional2/lang: Migrate trivial eval-fail tests
All changes are uniform and done with the same script, so checking only some should suffice. For that reason, any tests involving multiple files or custom CLI flags are not included in this commit. Change-Id: Ib2d0e08937b56e241d99771a58aad34ed3ad308a
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… while calling the 'abort' builtin
|
||||
at /pwd/eval-fail-abort.nix:1:14:
|
||||
at /pwd/in.nix:1:14:
|
||||
1| if true then abort "this should fail" else 1
|
||||
| ^
|
||||
2|
|
||||
+3
-3
@@ -1,20 +1,20 @@
|
||||
error:
|
||||
… from call site
|
||||
at /pwd/eval-fail-assert.nix:4:1:
|
||||
at /pwd/in.nix:4:1:
|
||||
3| in
|
||||
4| x "x"
|
||||
| ^
|
||||
5|
|
||||
|
||||
… while calling 'x'
|
||||
at /pwd/eval-fail-assert.nix:2:7:
|
||||
at /pwd/in.nix:2:7:
|
||||
1| let
|
||||
2| x = arg: assert arg == "y"; 123;
|
||||
| ^
|
||||
3| in
|
||||
|
||||
error: assertion failed
|
||||
at /pwd/eval-fail-assert.nix:2:12:
|
||||
at /pwd/in.nix:2:12:
|
||||
1| let
|
||||
2| x = arg: assert arg == "y"; 123;
|
||||
| ^
|
||||
+3
-3
@@ -1,20 +1,20 @@
|
||||
error:
|
||||
… while evaluating the attribute 'puppy."${...}"'
|
||||
at /pwd/eval-fail-attr-name-type.nix:3:5:
|
||||
at /pwd/in.nix:3:5:
|
||||
2| attrs = {
|
||||
3| puppy.doggy = {};
|
||||
| ^
|
||||
4| };
|
||||
|
||||
… while evaluating an attribute name
|
||||
at /pwd/eval-fail-attr-name-type.nix:7:17:
|
||||
at /pwd/in.nix:7:17:
|
||||
6| in
|
||||
7| attrs.puppy.${key}
|
||||
| ^
|
||||
8|
|
||||
|
||||
error: expected a string but found an integer: 1
|
||||
at /pwd/eval-fail-attr-name-type.nix:7:17:
|
||||
at /pwd/in.nix:7:17:
|
||||
6| in
|
||||
7| attrs.puppy.${key}
|
||||
| ^
|
||||
+3
-3
@@ -1,20 +1,20 @@
|
||||
error:
|
||||
… while evaluating x
|
||||
at /pwd/eval-fail-blackhole.nix:5:1:
|
||||
at /pwd/in.nix:5:1:
|
||||
4| in
|
||||
5| x
|
||||
| ^
|
||||
6|
|
||||
|
||||
… while evaluating y
|
||||
at /pwd/eval-fail-blackhole.nix:2:7:
|
||||
at /pwd/in.nix:2:7:
|
||||
1| let
|
||||
2| x = y;
|
||||
| ^
|
||||
3| y = x;
|
||||
|
||||
error: infinite recursion encountered
|
||||
at /pwd/eval-fail-blackhole.nix:2:7:
|
||||
at /pwd/in.nix:2:7:
|
||||
1| let
|
||||
2| x = y;
|
||||
| ^
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… while calling the 'length' builtin
|
||||
at /pwd/eval-fail-call-primop.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| builtins.length 1
|
||||
| ^
|
||||
2|
|
||||
+3
-3
@@ -1,18 +1,18 @@
|
||||
error:
|
||||
… while calling the 'deepSeq' builtin
|
||||
at /pwd/eval-fail-deepseq.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| builtins.deepSeq { x = abort "foo"; } 456
|
||||
| ^
|
||||
2|
|
||||
|
||||
… while evaluating the attribute 'x'
|
||||
at /pwd/eval-fail-deepseq.nix:1:20:
|
||||
at /pwd/in.nix:1:20:
|
||||
1| builtins.deepSeq { x = abort "foo"; } 456
|
||||
| ^
|
||||
2|
|
||||
|
||||
… while calling the 'abort' builtin
|
||||
at /pwd/eval-fail-deepseq.nix:1:24:
|
||||
at /pwd/in.nix:1:24:
|
||||
1| builtins.deepSeq { x = abort "foo"; } 456
|
||||
| ^
|
||||
2|
|
||||
+7
-7
@@ -1,48 +1,48 @@
|
||||
error:
|
||||
… from call site
|
||||
at /pwd/eval-fail-duplicate-traces.nix:9:3:
|
||||
at /pwd/in.nix:9:3:
|
||||
8| in
|
||||
9| throwAfter 2
|
||||
| ^
|
||||
10|
|
||||
|
||||
… while calling 'throwAfter'
|
||||
at /pwd/eval-fail-duplicate-traces.nix:4:16:
|
||||
at /pwd/in.nix:4:16:
|
||||
3| let
|
||||
4| throwAfter = n:
|
||||
| ^
|
||||
5| if n > 0
|
||||
|
||||
… from call site
|
||||
at /pwd/eval-fail-duplicate-traces.nix:6:10:
|
||||
at /pwd/in.nix:6:10:
|
||||
5| if n > 0
|
||||
6| then throwAfter (n - 1)
|
||||
| ^
|
||||
7| else throw "Uh oh!";
|
||||
|
||||
… while calling 'throwAfter'
|
||||
at /pwd/eval-fail-duplicate-traces.nix:4:16:
|
||||
at /pwd/in.nix:4:16:
|
||||
3| let
|
||||
4| throwAfter = n:
|
||||
| ^
|
||||
5| if n > 0
|
||||
|
||||
… from call site
|
||||
at /pwd/eval-fail-duplicate-traces.nix:6:10:
|
||||
at /pwd/in.nix:6:10:
|
||||
5| if n > 0
|
||||
6| then throwAfter (n - 1)
|
||||
| ^
|
||||
7| else throw "Uh oh!";
|
||||
|
||||
… while calling 'throwAfter'
|
||||
at /pwd/eval-fail-duplicate-traces.nix:4:16:
|
||||
at /pwd/in.nix:4:16:
|
||||
3| let
|
||||
4| throwAfter = n:
|
||||
| ^
|
||||
5| if n > 0
|
||||
|
||||
… caused by explicit throw
|
||||
at /pwd/eval-fail-duplicate-traces.nix:7:10:
|
||||
at /pwd/in.nix:7:10:
|
||||
6| then throwAfter (n - 1)
|
||||
7| else throw "Uh oh!";
|
||||
| ^
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… while calling the 'fetchTree' builtin
|
||||
at /pwd/eval-fail-fetchTree-negative.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| builtins.fetchTree {
|
||||
| ^
|
||||
2| type = "file";
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
error:
|
||||
… while calling the 'seq' builtin
|
||||
at /pwd/eval-fail-flake-ref-to-string-negative-integer.nix:1:16:
|
||||
at /pwd/in.nix:1:16:
|
||||
1| let n = -1; in builtins.seq n (builtins.flakeRefToString {
|
||||
| ^
|
||||
2| type = "github";
|
||||
|
||||
… while calling the 'flakeRefToString' builtin
|
||||
at /pwd/eval-fail-flake-ref-to-string-negative-integer.nix:1:32:
|
||||
at /pwd/in.nix:1:32:
|
||||
1| let n = -1; in builtins.seq n (builtins.flakeRefToString {
|
||||
| ^
|
||||
2| type = "github";
|
||||
+5
-5
@@ -1,34 +1,34 @@
|
||||
error:
|
||||
… while calling the 'foldl'' builtin
|
||||
at /pwd/eval-fail-foldlStrict-strict-op-application.nix:2:1:
|
||||
at /pwd/in.nix:2:1:
|
||||
1| # Tests that the result of applying op is forced even if the value is never used
|
||||
2| builtins.foldl'
|
||||
| ^
|
||||
3| (_: f: f null)
|
||||
|
||||
… while calling anonymous lambda
|
||||
at /pwd/eval-fail-foldlStrict-strict-op-application.nix:3:7:
|
||||
at /pwd/in.nix:3:7:
|
||||
2| builtins.foldl'
|
||||
3| (_: f: f null)
|
||||
| ^
|
||||
4| null
|
||||
|
||||
… from call site
|
||||
at /pwd/eval-fail-foldlStrict-strict-op-application.nix:3:10:
|
||||
at /pwd/in.nix:3:10:
|
||||
2| builtins.foldl'
|
||||
3| (_: f: f null)
|
||||
| ^
|
||||
4| null
|
||||
|
||||
… while calling anonymous lambda
|
||||
at /pwd/eval-fail-foldlStrict-strict-op-application.nix:5:6:
|
||||
at /pwd/in.nix:5:6:
|
||||
4| null
|
||||
5| [ (_: throw "Not the final value, but is still forced!") (_: 23) ]
|
||||
| ^
|
||||
6|
|
||||
|
||||
… caused by explicit throw
|
||||
at /pwd/eval-fail-foldlStrict-strict-op-application.nix:5:9:
|
||||
at /pwd/in.nix:5:9:
|
||||
4| null
|
||||
5| [ (_: throw "Not the final value, but is still forced!") (_: 23) ]
|
||||
| ^
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… while calling the 'fromJSON' builtin
|
||||
at /pwd/eval-fail-fromJSON-overflowing.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| builtins.fromJSON ''{"attr": 18446744073709551615}''
|
||||
| ^
|
||||
2|
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… while calling the 'fromTOML' builtin
|
||||
at /pwd/eval-fail-fromTOML-timestamps.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| builtins.fromTOML ''
|
||||
| ^
|
||||
2| key = "value"
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… while calling the 'toString' builtin
|
||||
at /pwd/eval-fail-hashfile-missing.nix:4:3:
|
||||
at /pwd/in.nix:4:3:
|
||||
3| in
|
||||
4| toString (builtins.concatLists (map (hash: map (builtins.hashFile hash) paths) ["md5" "sha1" "sha256" "sha512"]))
|
||||
| ^
|
||||
+6
-6
@@ -1,30 +1,30 @@
|
||||
error:
|
||||
… from call site
|
||||
at /pwd/eval-fail-infinite-recursion-lambda.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| (x: x x) (x: x x)
|
||||
| ^
|
||||
2|
|
||||
|
||||
… while calling anonymous lambda
|
||||
at /pwd/eval-fail-infinite-recursion-lambda.nix:1:2:
|
||||
at /pwd/in.nix:1:2:
|
||||
1| (x: x x) (x: x x)
|
||||
| ^
|
||||
2|
|
||||
|
||||
… from call site
|
||||
at /pwd/eval-fail-infinite-recursion-lambda.nix:1:5:
|
||||
at /pwd/in.nix:1:5:
|
||||
1| (x: x x) (x: x x)
|
||||
| ^
|
||||
2|
|
||||
|
||||
… while calling anonymous lambda
|
||||
at /pwd/eval-fail-infinite-recursion-lambda.nix:1:11:
|
||||
at /pwd/in.nix:1:11:
|
||||
1| (x: x x) (x: x x)
|
||||
| ^
|
||||
2|
|
||||
|
||||
… from call site
|
||||
at /pwd/eval-fail-infinite-recursion-lambda.nix:1:14:
|
||||
at /pwd/in.nix:1:14:
|
||||
1| (x: x x) (x: x x)
|
||||
| ^
|
||||
2|
|
||||
@@ -32,7 +32,7 @@ error:
|
||||
(19997 duplicate frames omitted)
|
||||
|
||||
error: stack overflow; max-call-depth exceeded
|
||||
at /pwd/eval-fail-infinite-recursion-lambda.nix:1:14:
|
||||
at /pwd/in.nix:1:14:
|
||||
1| (x: x x) (x: x x)
|
||||
| ^
|
||||
2|
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
error: expected a list but found an integer: 8
|
||||
at /pwd/eval-fail-list.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| 8++1
|
||||
| ^
|
||||
2|
|
||||
+8
-8
@@ -1,20 +1,20 @@
|
||||
error:
|
||||
… from call site
|
||||
at /pwd/eval-fail-mutual-recursion.nix:36:3:
|
||||
at /pwd/in.nix:36:3:
|
||||
35| in
|
||||
36| throwAfterA true 10
|
||||
| ^
|
||||
37|
|
||||
|
||||
… while calling 'throwAfterA'
|
||||
at /pwd/eval-fail-mutual-recursion.nix:29:26:
|
||||
at /pwd/in.nix:29:26:
|
||||
28|
|
||||
29| throwAfterA = recurse: n:
|
||||
| ^
|
||||
30| if n > 0
|
||||
|
||||
… from call site
|
||||
at /pwd/eval-fail-mutual-recursion.nix:31:10:
|
||||
at /pwd/in.nix:31:10:
|
||||
30| if n > 0
|
||||
31| then throwAfterA recurse (n - 1)
|
||||
| ^
|
||||
@@ -23,21 +23,21 @@ error:
|
||||
(19 duplicate frames omitted)
|
||||
|
||||
… from call site
|
||||
at /pwd/eval-fail-mutual-recursion.nix:33:10:
|
||||
at /pwd/in.nix:33:10:
|
||||
32| else if recurse
|
||||
33| then throwAfterB true 10
|
||||
| ^
|
||||
34| else throw "Uh oh!";
|
||||
|
||||
… while calling 'throwAfterB'
|
||||
at /pwd/eval-fail-mutual-recursion.nix:22:26:
|
||||
at /pwd/in.nix:22:26:
|
||||
21| let
|
||||
22| throwAfterB = recurse: n:
|
||||
| ^
|
||||
23| if n > 0
|
||||
|
||||
… from call site
|
||||
at /pwd/eval-fail-mutual-recursion.nix:24:10:
|
||||
at /pwd/in.nix:24:10:
|
||||
23| if n > 0
|
||||
24| then throwAfterB recurse (n - 1)
|
||||
| ^
|
||||
@@ -46,7 +46,7 @@ error:
|
||||
(19 duplicate frames omitted)
|
||||
|
||||
… from call site
|
||||
at /pwd/eval-fail-mutual-recursion.nix:26:10:
|
||||
at /pwd/in.nix:26:10:
|
||||
25| else if recurse
|
||||
26| then throwAfterA false 10
|
||||
| ^
|
||||
@@ -55,7 +55,7 @@ error:
|
||||
(21 duplicate frames omitted)
|
||||
|
||||
… caused by explicit throw
|
||||
at /pwd/eval-fail-mutual-recursion.nix:34:10:
|
||||
at /pwd/in.nix:34:10:
|
||||
33| then throwAfterB true 10
|
||||
34| else throw "Uh oh!";
|
||||
| ^
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… caused by explicit throw
|
||||
at /pwd/eval-fail-not-throws.nix:1:4:
|
||||
at /pwd/in.nix:1:4:
|
||||
1| ! (throw "uh oh!")
|
||||
| ^
|
||||
2|
|
||||
+4
-4
@@ -1,24 +1,24 @@
|
||||
error:
|
||||
… while evaluating an expression to select 'foo' on it
|
||||
at /pwd/eval-fail-recursion.nix:1:21:
|
||||
at /pwd/in.nix:1:21:
|
||||
1| let a = {} // a; in a.foo
|
||||
| ^
|
||||
2|
|
||||
|
||||
… while evaluating a
|
||||
at /pwd/eval-fail-recursion.nix:1:21:
|
||||
at /pwd/in.nix:1:21:
|
||||
1| let a = {} // a; in a.foo
|
||||
| ^
|
||||
2|
|
||||
|
||||
… while evaluating a
|
||||
at /pwd/eval-fail-recursion.nix:1:15:
|
||||
at /pwd/in.nix:1:15:
|
||||
1| let a = {} // a; in a.foo
|
||||
| ^
|
||||
2|
|
||||
|
||||
error: infinite recursion encountered
|
||||
at /pwd/eval-fail-recursion.nix:1:15:
|
||||
at /pwd/in.nix:1:15:
|
||||
1| let a = {} // a; in a.foo
|
||||
| ^
|
||||
2|
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
error: attribute 'x' missing
|
||||
at /pwd/eval-fail-remove.nix:4:29:
|
||||
at /pwd/in.nix:4:29:
|
||||
3| in
|
||||
4| (removeAttrs attrs ["x"]).x
|
||||
| ^
|
||||
+3
-3
@@ -1,20 +1,20 @@
|
||||
error:
|
||||
… while evaluating the attribute 'src.meta'
|
||||
at /pwd/eval-fail-select-err.nix:2:3:
|
||||
at /pwd/in.nix:2:3:
|
||||
1| let
|
||||
2| somepkg.src = throw "invalid foo bar";
|
||||
| ^
|
||||
3| in somepkg.src.meta
|
||||
|
||||
… while evaluating an expression to select 'meta' on it
|
||||
at /pwd/eval-fail-select-err.nix:3:16:
|
||||
at /pwd/in.nix:3:16:
|
||||
2| somepkg.src = throw "invalid foo bar";
|
||||
3| in somepkg.src.meta
|
||||
| ^
|
||||
4|
|
||||
|
||||
… caused by explicit throw
|
||||
at /pwd/eval-fail-select-err.nix:2:17:
|
||||
at /pwd/in.nix:2:17:
|
||||
1| let
|
||||
2| somepkg.src = throw "invalid foo bar";
|
||||
| ^
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
error:
|
||||
… while calling the 'seq' builtin
|
||||
at /pwd/eval-fail-seq.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| builtins.seq (abort "foo") 2
|
||||
| ^
|
||||
2|
|
||||
|
||||
… while calling the 'abort' builtin
|
||||
at /pwd/eval-fail-seq.nix:1:15:
|
||||
at /pwd/in.nix:1:15:
|
||||
1| builtins.seq (abort "foo") 2
|
||||
| ^
|
||||
2|
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… while calling the 'substring' builtin
|
||||
at /pwd/eval-fail-substring.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| builtins.substring (builtins.sub 0 1) 1 "x"
|
||||
| ^
|
||||
2|
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… while calling the 'toPath' builtin
|
||||
at /pwd/eval-fail-to-path.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| builtins.toPath "foo/bar"
|
||||
| ^
|
||||
2|
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
error:
|
||||
… while calling the 'toString' builtin
|
||||
at /pwd/eval-fail-toString.nix:1:1:
|
||||
at /pwd/in.nix:1:1:
|
||||
1| toString { __toString = 1; }
|
||||
| ^
|
||||
2|
|
||||
@@ -8,7 +8,7 @@ error:
|
||||
… while converting a set to string
|
||||
|
||||
error: attempt to call something which is not a function but an integer: 1
|
||||
at /pwd/eval-fail-toString.nix:1:12:
|
||||
at /pwd/in.nix:1:12:
|
||||
1| toString { __toString = 1; }
|
||||
| ^
|
||||
2|
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
error:
|
||||
… while evaluating an attribute name
|
||||
at /pwd/eval-fail-using-set-as-attr-name.nix:5:10:
|
||||
at /pwd/in.nix:5:10:
|
||||
4| in
|
||||
5| attr.${key}
|
||||
| ^
|
||||
6|
|
||||
|
||||
error: expected a string but found a set: { }
|
||||
at /pwd/eval-fail-using-set-as-attr-name.nix:5:10:
|
||||
at /pwd/in.nix:5:10:
|
||||
4| in
|
||||
5| attr.${key}
|
||||
| ^
|
||||
Reference in New Issue
Block a user