From cb45536124ce5cd1f34dc16bc853ecaaf8f08980 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 28 Aug 2019 14:31:45 +0100 Subject: test: Add a test to check that all types match the 'type'-type --- z-yants-tests.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'z-yants-tests.nix') 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" -- cgit 1.4.1