Add a test of the type primops
This commit is contained in:
parent
05d02f798f
commit
411a3461dc
1
tests/lang/eval-okay-types.exp
Normal file
1
tests/lang/eval-okay-types.exp
Normal file
|
@ -0,0 +1 @@
|
|||
[ true false true false true false true false true false "int" "bool" "string" "null" "attrs" "list" "lambda" "lambda" "lambda" "lambda" ]
|
23
tests/lang/eval-okay-types.nix
Normal file
23
tests/lang/eval-okay-types.nix
Normal 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)))
|
||||
]
|
Loading…
Reference in a new issue