about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2017-04-12 12:40:24 -0400
committerShea Levy <shea@shealevy.com>2017-04-12 12:40:24 -0400
commitb2c87fbf98cf5d4a57cb4528cf60cabefc4d5282 (patch)
treed774439839273487b530c8ffe667b907a542c7b7 /lib
parentae002d6ecb592350ae0da1e614f5bd099f5aa3f3 (diff)
lib: Add test for composeExtensions
Diffstat (limited to 'lib')
-rw-r--r--lib/tests.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tests.nix b/lib/tests.nix
index 1a9a5accd1c03..d93cadf253351 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;
+  };
+
 }