diff options
Diffstat (limited to 'tests/functional/lang')
7 files changed, 24 insertions, 11 deletions
diff --git a/tests/functional/lang/eval-fail-dupAttr-inherit.err.exp b/tests/functional/lang/eval-fail-dupAttr-inherit.err.exp index 7744b838f..3e6475a1c 100644 --- a/tests/functional/lang/eval-fail-dupAttr-inherit.err.exp +++ b/tests/functional/lang/eval-fail-dupAttr-inherit.err.exp @@ -1,4 +1,4 @@ -error: attribute 'a' already defined at /pwd/lang/eval-fail-dupAttr-inherit.nix:1:15 +error: attribute 'a' already defined at /pwd/lang/eval-fail-dupAttr-inherit.nix:1:16 at /pwd/lang/eval-fail-dupAttr-inherit.nix:1:19: 1| { inherit ({}) a; a.b = 1; } | ^ diff --git a/tests/functional/lang/eval-okay-inherit-attr-pos.exp b/tests/functional/lang/eval-okay-inherit-attr-pos.exp new file mode 100644 index 000000000..e87d037c6 --- /dev/null +++ b/tests/functional/lang/eval-okay-inherit-attr-pos.exp @@ -0,0 +1 @@ +[ { column = 17; file = "/pwd/lang/eval-okay-inherit-attr-pos.nix"; line = 4; } { column = 19; file = "/pwd/lang/eval-okay-inherit-attr-pos.nix"; line = 4; } { column = 21; file = "/pwd/lang/eval-okay-inherit-attr-pos.nix"; line = 5; } { column = 23; file = "/pwd/lang/eval-okay-inherit-attr-pos.nix"; line = 5; } ] diff --git a/tests/functional/lang/eval-okay-inherit-attr-pos.nix b/tests/functional/lang/eval-okay-inherit-attr-pos.nix new file mode 100644 index 000000000..017ab1d36 --- /dev/null +++ b/tests/functional/lang/eval-okay-inherit-attr-pos.nix @@ -0,0 +1,12 @@ +let + d = 0; + x = 1; + y = { inherit d x; }; + z = { inherit (y) d x; }; +in + [ + (builtins.unsafeGetAttrPos "d" y) + (builtins.unsafeGetAttrPos "x" y) + (builtins.unsafeGetAttrPos "d" z) + (builtins.unsafeGetAttrPos "x" z) + ] diff --git a/tests/functional/lang/parse-fail-dup-attrs-2.err.exp b/tests/functional/lang/parse-fail-dup-attrs-2.err.exp index 4607a5d59..3105e60de 100644 --- a/tests/functional/lang/parse-fail-dup-attrs-2.err.exp +++ b/tests/functional/lang/parse-fail-dup-attrs-2.err.exp @@ -1,6 +1,6 @@ error: attribute 'x' already defined at «stdin»:9:5 - at «stdin»:10:17: + at «stdin»:10:18: 9| x = 789; 10| inherit (as) x; - | ^ + | ^ 11| }; diff --git a/tests/functional/lang/parse-fail-dup-attrs-3.err.exp b/tests/functional/lang/parse-fail-dup-attrs-3.err.exp index 4607a5d59..3105e60de 100644 --- a/tests/functional/lang/parse-fail-dup-attrs-3.err.exp +++ b/tests/functional/lang/parse-fail-dup-attrs-3.err.exp @@ -1,6 +1,6 @@ error: attribute 'x' already defined at «stdin»:9:5 - at «stdin»:10:17: + at «stdin»:10:18: 9| x = 789; 10| inherit (as) x; - | ^ + | ^ 11| }; diff --git a/tests/functional/lang/parse-fail-dup-attrs-7.err.exp b/tests/functional/lang/parse-fail-dup-attrs-7.err.exp index 2daddf380..4e0a48eff 100644 --- a/tests/functional/lang/parse-fail-dup-attrs-7.err.exp +++ b/tests/functional/lang/parse-fail-dup-attrs-7.err.exp @@ -1,6 +1,6 @@ -error: attribute 'x' already defined at «stdin»:6:12 - at «stdin»:7:12: +error: attribute 'x' already defined at «stdin»:6:13 + at «stdin»:7:13: 6| inherit x; 7| inherit x; - | ^ + | ^ 8| }; diff --git a/tests/functional/lang/parse-fail-regression-20060610.err.exp b/tests/functional/lang/parse-fail-regression-20060610.err.exp index d8875a6a5..6ae7c01bf 100644 --- a/tests/functional/lang/parse-fail-regression-20060610.err.exp +++ b/tests/functional/lang/parse-fail-regression-20060610.err.exp @@ -1,6 +1,6 @@ error: undefined variable 'gcc' - at «stdin»:8:12: - 7| + at «stdin»:9:13: 8| body = ({ - | ^ 9| inherit gcc; + | ^ + 10| }).gcc; |