fix and test rev

This commit is contained in:
alex 2022-01-27 08:28:13 +00:00
parent cba0084e3d
commit 2756155b7c
2 changed files with 14 additions and 5 deletions

View file

@ -115,4 +115,9 @@ describe('Pattern', function() {
assert.deepStrictEqual(slowcat([pure("a"), pure("b")])._early(1).firstCycle.map(x => x.value), ["b"])
})
})
describe('rev()', function () {
it('Can reverse things', function () {
assert.deepStrictEqual(fastcat([pure("a"), pure("b"), pure("c")]).rev().firstCycle.sort((a,b) => a.part.begin.sub(b.part.begin)).map(a => a.value), ["c", "b","a"])
})
})
})