Skip to content

Commit

Permalink
reuse S.filter tests for S.filterM
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Jan 21, 2017
1 parent 8abab1c commit d013dbc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/filterM.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,12 @@ test('filterM', function() {
eq(S.filterM.length, 2);
eq(S.filterM.toString(), 'filterM :: (Monad m, Monoid m) => (a -> Boolean) -> m a -> m a');

eq(S.filterM(S.odd, []), []);
eq(S.filterM(S.odd, [0, 2, 4, 6, 8]), []);
eq(S.filterM(S.odd, [1, 3, 5, 7, 9]), [1, 3, 5, 7, 9]);
eq(S.filterM(S.odd, [1, 2, 3, 4, 5]), [1, 3, 5]);
eq(S.filterM(S.odd, S.Nothing), S.Nothing);
eq(S.filterM(S.odd, S.Just(4)), S.Nothing);
eq(S.filterM(S.odd, S.Just(9)), S.Just(9));

});

0 comments on commit d013dbc

Please sign in to comment.