diff options
Diffstat (limited to 'test/testdata/eval-okay-types.nix')
-rw-r--r-- | test/testdata/eval-okay-types.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/testdata/eval-okay-types.nix b/test/testdata/eval-okay-types.nix new file mode 100644 index 0000000..9b58be5 --- /dev/null +++ b/test/testdata/eval-okay-types.nix | |||
@@ -0,0 +1,37 @@ | |||
1 | with builtins; | ||
2 | |||
3 | [ (isNull null) | ||
4 | (isNull (x: x)) | ||
5 | (isFunction (x: x)) | ||
6 | (isFunction "fnord") | ||
7 | (isString ("foo" + "bar")) | ||
8 | (isString [ "x" ]) | ||
9 | (isInt (1 + 2)) | ||
10 | (isInt { x = 123; }) | ||
11 | (isInt (1 / 2)) | ||
12 | (isInt (1 + 1)) | ||
13 | (isInt (1 / 2)) | ||
14 | (isInt (1 * 2)) | ||
15 | (isInt (1 - 2)) | ||
16 | (isFloat (1.2)) | ||
17 | (isFloat (1 + 1.0)) | ||
18 | (isFloat (1 / 2.0)) | ||
19 | (isFloat (1 * 2.0)) | ||
20 | (isFloat (1 - 2.0)) | ||
21 | (isBool (true && false)) | ||
22 | (isBool null) | ||
23 | (isPath /nix/store) | ||
24 | (isPath ./.) | ||
25 | (isAttrs { x = 123; }) | ||
26 | (isAttrs null) | ||
27 | (typeOf (3 * 4)) | ||
28 | (typeOf true) | ||
29 | (typeOf "xyzzy") | ||
30 | (typeOf null) | ||
31 | (typeOf { x = 456; }) | ||
32 | (typeOf [ 1 2 3 ]) | ||
33 | (typeOf (x: x)) | ||
34 | (typeOf ((x: y: x) 1)) | ||
35 | (typeOf map) | ||
36 | (typeOf (map (x: x))) | ||
37 | ] | ||