From ebade9ff8b8557bdae7cdaf9f70c12ceeb3dc02c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 22 Apr 2010 11:02:24 +0000 Subject: * Check for duplicate attribute names / function arguments. `make check' now succeeds :-) * An attribute set such as `{ foo = { enable = true; }; foo.port = 23; }' now parses. It was previously rejected, but I'm too lazy to implement the check. (The only reason to reject it is that the reverse, `{ foo.port = 23; foo = { enable = true; }; }', is rejected, which is kind of ugly.) --- tests/lang/eval-okay-context.exp | 2 +- tests/lang/parse-fail-dup-attrs-5.nix | 4 ---- tests/lang/parse-fail-dup-attrs-7.nix | 9 +++++++++ tests/lang/parse-okay-dup-attrs-5.nix | 4 ++++ 4 files changed, 14 insertions(+), 5 deletions(-) delete mode 100644 tests/lang/parse-fail-dup-attrs-5.nix create mode 100644 tests/lang/parse-fail-dup-attrs-7.nix create mode 100644 tests/lang/parse-okay-dup-attrs-5.nix (limited to 'tests/lang') diff --git a/tests/lang/eval-okay-context.exp b/tests/lang/eval-okay-context.exp index 95a993654263..2f535bdbc454 100644 --- a/tests/lang/eval-okay-context.exp +++ b/tests/lang/eval-okay-context.exp @@ -1 +1 @@ -Str("foo eval-okay-context.nix bar",[]) +"foo eval-okay-context.nix bar" diff --git a/tests/lang/parse-fail-dup-attrs-5.nix b/tests/lang/parse-fail-dup-attrs-5.nix deleted file mode 100644 index f4b9efd0c596..000000000000 --- a/tests/lang/parse-fail-dup-attrs-5.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - services.ssh = { enable = true; }; - services.ssh.port = 23; -} diff --git a/tests/lang/parse-fail-dup-attrs-7.nix b/tests/lang/parse-fail-dup-attrs-7.nix new file mode 100644 index 000000000000..bbc3eb08c0f6 --- /dev/null +++ b/tests/lang/parse-fail-dup-attrs-7.nix @@ -0,0 +1,9 @@ +rec { + + x = 1; + + as = { + inherit x; + inherit x; + }; +} \ No newline at end of file diff --git a/tests/lang/parse-okay-dup-attrs-5.nix b/tests/lang/parse-okay-dup-attrs-5.nix new file mode 100644 index 000000000000..f4b9efd0c596 --- /dev/null +++ b/tests/lang/parse-okay-dup-attrs-5.nix @@ -0,0 +1,4 @@ +{ + services.ssh = { enable = true; }; + services.ssh.port = 23; +} -- cgit 1.4.1