From 411a3461dca6b26f1a1a6b0c7f1f322f1d8df506 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 24 Oct 2013 02:51:28 +0200 Subject: [PATCH] Add a test of the type primops --- tests/lang/eval-okay-types.exp | 1 + tests/lang/eval-okay-types.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/lang/eval-okay-types.exp create mode 100644 tests/lang/eval-okay-types.nix diff --git a/tests/lang/eval-okay-types.exp b/tests/lang/eval-okay-types.exp new file mode 100644 index 0000000000..0287a32b11 --- /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 0000000000..c3fe370ef7 --- /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))) +]