Add a test of the type primops

This commit is contained in:
Eelco Dolstra 2013-10-24 02:51:28 +02:00
parent 05d02f798f
commit 411a3461dc
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1 @@
[ true false true false true false true false true false "int" "bool" "string" "null" "attrs" "list" "lambda" "lambda" "lambda" "lambda" ]

View file

@ -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)))
]