From fff10f43bde3eb60e261db97be3b4a3aa2f95ad9 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 10 Feb 2022 17:40:59 +0000 Subject: [PATCH] Failing test for `when` --- test/pattern.test.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/pattern.test.mjs b/test/pattern.test.mjs index 7fa8bdfe..ca594df2 100644 --- a/test/pattern.test.mjs +++ b/test/pattern.test.mjs @@ -178,6 +178,12 @@ describe('Pattern', function() { it('Never faster', function () { assert.equal(pure("a").when(pure(false), x => x._fast(2)).firstCycle.length, 1) }) + it('Can alternate', function () { + assert.deepStrictEqual( + pure(10).when(slowcat(true,false),add(3)).fast(4).firstCycle, + slowcat(10,13,10,10).firstCycle + ) + }) }) describe('fastcat()', function () { it('Can concatenate two things', function () {