diff options
author | Shea Levy <shea@shealevy.com> | 2017-04-12 12:40:24 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2017-04-12 12:40:24 -0400 |
commit | b2c87fbf98cf5d4a57cb4528cf60cabefc4d5282 (patch) | |
tree | d774439839273487b530c8ffe667b907a542c7b7 /lib | |
parent | ae002d6ecb592350ae0da1e614f5bd099f5aa3f3 (diff) |
lib: Add test for composeExtensions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tests.nix | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tests.nix b/lib/tests.nix index 1a9a5accd1c0..d93cadf25335 100644 --- a/lib/tests.nix +++ b/lib/tests.nix @@ -277,4 +277,14 @@ runTests { expected = [ "2001" "db8" "0" "0042" "" "8a2e" "370" "" ]; }; + testComposeExtensions = { + expr = let obj = makeExtensible (self: { foo = self.bar; }); + f = self: super: { bar = false; baz = true; }; + g = self: super: { bar = super.baz or false; }; + f_o_g = composeExtensions f g; + composed = obj.extend f_o_g; + in composed.foo; + expected = true; + }; + } |