FIXES: palindrome abc -> abccba (#831)
* FIXES: palindrome abc -> abccba * FIXES: tests for palindrome --------- Co-authored-by: Bernhard Wagner <gitcommit@nosuch.biz>
This commit is contained in:
parent
b374cdf47c
commit
1bca05e349
4 changed files with 40 additions and 27 deletions
|
|
@ -20,6 +20,7 @@ import {
|
|||
slowcat,
|
||||
cat,
|
||||
sequence,
|
||||
palindrome,
|
||||
polymeter,
|
||||
polymeterSteps,
|
||||
polyrhythm,
|
||||
|
|
@ -571,6 +572,18 @@ describe('Pattern', () => {
|
|||
expect(sequence(1, 2, 3).firstCycle()).toStrictEqual(fastcat(1, 2, 3).firstCycle());
|
||||
});
|
||||
});
|
||||
describe('palindrome()', () => {
|
||||
it('Can create palindrome', () => {
|
||||
expect(
|
||||
fastcat('a', 'b', 'c')
|
||||
.palindrome()
|
||||
.fast(2)
|
||||
.firstCycle()
|
||||
.sort((a, b) => a.part.begin.sub(b.part.begin))
|
||||
.map((a) => a.value),
|
||||
).toStrictEqual(['a', 'b', 'c', 'c', 'b', 'a']);
|
||||
});
|
||||
});
|
||||
describe('polyrhythm()', () => {
|
||||
it('Can layer up cycles', () => {
|
||||
expect(polyrhythm(['a', 'b'], ['c']).firstCycle()).toStrictEqual(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue