about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/eval-okay-patterns.exp1
-rw-r--r--tests/lang/eval-okay-patterns.nix16
-rw-r--r--tests/lang/eval-okay-xml.exp.xml12
-rw-r--r--tests/lang/eval-okay-xml.nix2
-rw-r--r--tests/lang/parse-fail-patterns-1.nix1
5 files changed, 32 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-patterns.exp b/tests/lang/eval-okay-patterns.exp
new file mode 100644
index 000000000000..382a0bd26f08
--- /dev/null
+++ b/tests/lang/eval-okay-patterns.exp
@@ -0,0 +1 @@
+Str("abcxyzDDDDEFgh",[])
diff --git a/tests/lang/eval-okay-patterns.nix b/tests/lang/eval-okay-patterns.nix
new file mode 100644
index 000000000000..bcb9f3842e47
--- /dev/null
+++ b/tests/lang/eval-okay-patterns.nix
@@ -0,0 +1,16 @@
+let
+
+  f = args@{x, y, z}: x + args.y + z;
+
+  g = {x, y, z}@args: f args;
+
+  h = {x ? "d", y ? x, z ? args.x}@args: x + y + z;
+
+  i = args@args2: args.x + args2.y;
+
+in
+  f {x = "a"; y = "b"; z = "c";} +
+  g {x = "x"; y = "y"; z = "z";} +
+  h {x = "D";} +
+  h {x = "D"; y = "E"; z = "F";} +
+  i {x = "g"; y = "h";}
diff --git a/tests/lang/eval-okay-xml.exp.xml b/tests/lang/eval-okay-xml.exp.xml
index 4798e87f87b8..4f55c69a7cad 100644
--- a/tests/lang/eval-okay-xml.exp.xml
+++ b/tests/lang/eval-okay-xml.exp.xml
@@ -4,6 +4,18 @@
     <attr name="a">
       <string value="foo" />
     </attr>
+    <attr name="at">
+      <function>
+        <at>
+          <varpat name="args" />
+          <attrspat>
+            <attr name="x" />
+            <attr name="y" />
+            <attr name="z" />
+          </attrspat>
+        </at>
+      </function>
+    </attr>
     <attr name="b">
       <string value="bar" />
     </attr>
diff --git a/tests/lang/eval-okay-xml.nix b/tests/lang/eval-okay-xml.nix
index 75420316df99..44afbff1ed13 100644
--- a/tests/lang/eval-okay-xml.nix
+++ b/tests/lang/eval-okay-xml.nix
@@ -12,4 +12,6 @@ rec {
 
   id = x: x;
 
+  at = args@{x, y, z}: x;
+
 }
diff --git a/tests/lang/parse-fail-patterns-1.nix b/tests/lang/parse-fail-patterns-1.nix
new file mode 100644
index 000000000000..7b40616417b8
--- /dev/null
+++ b/tests/lang/parse-fail-patterns-1.nix
@@ -0,0 +1 @@
+args@{args, x, y, z}: x