Add tests
This commit is contained in:
parent
0a408e464a
commit
947b263b9c
1 changed files with 13 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ import {
|
||||||
rev,
|
rev,
|
||||||
time,
|
time,
|
||||||
run,
|
run,
|
||||||
|
binary,
|
||||||
pick,
|
pick,
|
||||||
stackLeft,
|
stackLeft,
|
||||||
stackRight,
|
stackRight,
|
||||||
|
|
@ -958,6 +959,18 @@ describe('Pattern', () => {
|
||||||
expect(run(4).firstCycle()).toStrictEqual(sequence(0, 1, 2, 3).firstCycle());
|
expect(run(4).firstCycle()).toStrictEqual(sequence(0, 1, 2, 3).firstCycle());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
describe('binary', () => {
|
||||||
|
it('Can make a binary pattern from a decimal', () => {
|
||||||
|
expect(binary(55532).firstCycle()).toStrictEqual(
|
||||||
|
sequence(1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0).firstCycle(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('Can make a binary pattern from a numerical pattern', () => {
|
||||||
|
expect(binary(pure(0x1337)).firstCycle()).toStrictEqual(
|
||||||
|
sequence(0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1).firstCycle(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
describe('ribbon', () => {
|
describe('ribbon', () => {
|
||||||
it('Can ribbon', () => {
|
it('Can ribbon', () => {
|
||||||
expect(cat(0, 1, 2, 3, 4, 5, 6, 7).ribbon(2, 4).fast(4).firstCycle()).toStrictEqual(
|
expect(cat(0, 1, 2, 3, 4, 5, 6, 7).ribbon(2, 4).fast(4).firstCycle()).toStrictEqual(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue