diff options
author | Vincent Ambo <tazjin@google.com> | 2019-08-28T13·31+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2019-08-28T13·37+0100 |
commit | cb45536124ce5cd1f34dc16bc853ecaaf8f08980 (patch) | |
tree | 575ccf8b535b16733fe7306dbeab68adbb29127a /z-yants-tests.nix | |
parent | b622bcef7de3d69d3aa52b9c43c89906c75f0ae3 (diff) |
test: Add a test to check that all types match the 'type'-type
Diffstat (limited to 'z-yants-tests.nix')
-rw-r--r-- | z-yants-tests.nix | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/z-yants-tests.nix b/z-yants-tests.nix index f468f61322ec..b97d058c0447 100644 --- a/z-yants-tests.nix +++ b/z-yants-tests.nix @@ -1,5 +1,5 @@ -with (import ./yants.nix {}); with builtins; +with (import ./yants.nix {}); # Note: Derivations are not included in the tests below as they cause # issues with deepSeq. @@ -68,4 +68,18 @@ deepSeq rec { (name: age: "${name} is ${toString age} years old"); testFunc = func "Brynhjulf" 42; + + # Test that all types are types. + testTypes = map type [ + any bool drv float int string + + (attrs int) + (either int string) + (enum [ "foo" "bar" ]) + (list string) + (option int) + (option (list string)) + (struct { a = int; b = option string; }) + (sum { a = int; b = option string; }) + ]; } "All tests passed!\n" |