about summary refs log tree commit diff
path: root/tests/lang
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-24T00·51+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-24T00·51+0200
commit411a3461dca6b26f1a1a6b0c7f1f322f1d8df506 (patch)
tree2b10ffb51d506686e77eee6b7317dde692327e9e /tests/lang
parent05d02f798f65bf18e8ca71f3d23bfdf9df63fb7c (diff)
Add a test of the type primops
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)))
+]