Skip to content

Commit

Permalink
use different types for ‘a’ and ‘b’ in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Jul 26, 2020
1 parent 11b98fc commit b7fbca2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/fromLeft.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test ('fromLeft', () => {

eq (S.show (S.fromLeft)) ('fromLeft :: a -> Either a b -> a');

eq (S.fromLeft (0) (S.Left (42))) (42);
eq (S.fromLeft (0) (S.Right (42))) (0);
eq (S.fromLeft ('abc') (S.Left ('xyz'))) ('xyz');
eq (S.fromLeft ('abc') (S.Right (123))) ('abc');

});
4 changes: 2 additions & 2 deletions test/fromRight.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test ('fromRight', () => {

eq (S.show (S.fromRight)) ('fromRight :: b -> Either a b -> b');

eq (S.fromRight (0) (S.Left (42))) (0);
eq (S.fromRight (0) (S.Right (42))) (42);
eq (S.fromRight (123) (S.Right (789))) (789);
eq (S.fromRight (123) (S.Left ('abc'))) (123);

});

0 comments on commit b7fbca2

Please sign in to comment.