aboutsummaryrefslogtreecommitdiff
path: root/tests/lang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/eval-fail-assert.nix5
-rw-r--r--tests/lang/eval-okay-attrs.exp1
-rw-r--r--tests/lang/eval-okay-attrs.nix5
-rw-r--r--tests/lang/eval-okay-if.exp1
-rw-r--r--tests/lang/eval-okay-if.nix1
-rw-r--r--tests/lang/eval-okay-logic.exp1
-rw-r--r--tests/lang/eval-okay-logic.nix1
7 files changed, 15 insertions, 0 deletions
diff --git a/tests/lang/eval-fail-assert.nix b/tests/lang/eval-fail-assert.nix
new file mode 100644
index 000000000..3b7a1e8bf
--- /dev/null
+++ b/tests/lang/eval-fail-assert.nix
@@ -0,0 +1,5 @@
+let {
+ x = arg: assert arg == "y"; 123;
+
+ body = x "x";
+} \ No newline at end of file
diff --git a/tests/lang/eval-okay-attrs.exp b/tests/lang/eval-okay-attrs.exp
new file mode 100644
index 000000000..add36384d
--- /dev/null
+++ b/tests/lang/eval-okay-attrs.exp
@@ -0,0 +1 @@
+Int(987) \ No newline at end of file
diff --git a/tests/lang/eval-okay-attrs.nix b/tests/lang/eval-okay-attrs.nix
new file mode 100644
index 000000000..810b31a5d
--- /dev/null
+++ b/tests/lang/eval-okay-attrs.nix
@@ -0,0 +1,5 @@
+let {
+ as = { x = 123; y = 456; } // { z = 789; } // { z = 987; };
+
+ body = if as ? a then as.a else assert as ? z; as.z;
+}
diff --git a/tests/lang/eval-okay-if.exp b/tests/lang/eval-okay-if.exp
new file mode 100644
index 000000000..8b99801d3
--- /dev/null
+++ b/tests/lang/eval-okay-if.exp
@@ -0,0 +1 @@
+Int(3) \ No newline at end of file
diff --git a/tests/lang/eval-okay-if.nix b/tests/lang/eval-okay-if.nix
new file mode 100644
index 000000000..23e4c74d5
--- /dev/null
+++ b/tests/lang/eval-okay-if.nix
@@ -0,0 +1 @@
+if "foo" != "f" + "oo" then 1 else if false then 2 else 3
diff --git a/tests/lang/eval-okay-logic.exp b/tests/lang/eval-okay-logic.exp
new file mode 100644
index 000000000..f1161b8d5
--- /dev/null
+++ b/tests/lang/eval-okay-logic.exp
@@ -0,0 +1 @@
+Int(1) \ No newline at end of file
diff --git a/tests/lang/eval-okay-logic.nix b/tests/lang/eval-okay-logic.nix
new file mode 100644
index 000000000..fbb127944
--- /dev/null
+++ b/tests/lang/eval-okay-logic.nix
@@ -0,0 +1 @@
+assert !false && (true || false) -> true; 1