diff --git a/test/filterM.js b/test/filterM.js index 207d16bd..c6e7381d 100644 --- a/test/filterM.js +++ b/test/filterM.js @@ -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)); + });