Merge pull request #10 from tidalcycles/bug-when

Failing test for `when` WIP
This commit is contained in:
Alex McLean 2022-02-19 15:07:07 +00:00 committed by GitHub
commit 7456810517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)._sortEventsByPart().firstCycle,
fastcat(13,10,13,10).firstCycle
)
})
})
describe('fastcat()', function () {
it('Can concatenate two things', function () {