about summary refs log tree commit diff
path: root/tests/lang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/eval-okay-types.exp1
-rw-r--r--tests/lang/eval-okay-types.nix23
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-types.exp b/tests/lang/eval-okay-types.exp
new file mode 100644
index 000000000000..0287a32b119a
--- /dev/null
+++ b/tests/lang/eval-okay-types.exp
@@ -0,0 +1 @@
+[ true false true false true false true false true false "int" "bool" "string" "null" "attrs" "list" "lambda" "lambda" "lambda" "lambda" ]
diff --git a/tests/lang/eval-okay-types.nix b/tests/lang/eval-okay-types.nix
new file mode 100644
index 000000000000..c3fe370ef770
--- /dev/null
+++ b/tests/lang/eval-okay-types.nix
@@ -0,0 +1,23 @@
+with builtins;
+
+[ (isNull null)
+  (isNull (x: x))
+  (isFunction (x: x))
+  (isFunction "fnord")
+  (isString ("foo" + "bar"))
+  (isString [ "x" ])
+  (isInt (1 + 2))
+  (isInt { x = 123; })
+  (isBool (true && false))
+  (isBool null)
+  (typeOf (3 * 4))
+  (typeOf true)
+  (typeOf "xyzzy")
+  (typeOf null)
+  (typeOf { x = 456; })
+  (typeOf [ 1 2 3 ])
+  (typeOf (x: x))
+  (typeOf ((x: y: x) 1))
+  (typeOf map)
+  (typeOf (map (x: x)))
+]