From 8abab1c2ff8d76de038f54f95a337dd2e4354958 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Sat, 21 Jan 2017 14:05:45 +0100 Subject: [PATCH] test all four Nothing/Just permutations for S.ap --- test/ap.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/ap.js b/test/ap.js index 5f8ef148..73d04cef 100644 --- a/test/ap.js +++ b/test/ap.js @@ -16,6 +16,9 @@ test('ap', function() { eq(S.ap([S.inc], []), []); eq(S.ap([S.inc], [1, 2, 3]), [2, 3, 4]); eq(S.ap([S.dec, Math.sqrt], [1, 4, 9]), [0, 3, 8, 1, 2, 3]); - eq(S.ap(S.Just(S.inc), S.Just(42)), S.Just(43)); + eq(S.ap(S.Nothing, S.Nothing), S.Nothing); + eq(S.ap(S.Nothing, S.Just(9)), S.Nothing); + eq(S.ap(S.Just(Math.sqrt), S.Nothing), S.Nothing); + eq(S.ap(S.Just(Math.sqrt), S.Just(9)), S.Just(3)); });