Skip to content

Commit

Permalink
lib: Add test for composeExtensions
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Apr 12, 2017
1 parent ae002d6 commit b2c87fb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/tests.nix
Expand Up @@ -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;
};

}

0 comments on commit b2c87fb

Please sign in to comment.