Add tests for randrun and negative time test for run

This commit is contained in:
Tijmen Zwaan
2026-08-13 04:13:21 +02:00
parent 91f37accdd
commit 20d925c10c
+12
View File
@@ -46,6 +46,7 @@ import {
rev,
time,
run,
randrun,
binaryN,
pick,
stackLeft,
@@ -982,6 +983,17 @@ describe('Pattern', () => {
it('Can run', () => {
expect(run(4).firstCycle()).toStrictEqual(sequence(0, 1, 2, 3).firstCycle());
});
it('Can go into negative time', () => {
expect(run(4).late(1).firstCycle()).toStrictEqual(sequence(0, 1, 2, 3).firstCycle());
});
});
describe('randrun', () => {
it('Can randrun', () => {
expect(randrun(4).firstCycle()).toStrictEqual(sequence(2, 1, 3, 0).firstCycle());
});
it('Can go into negative time', () => {
expect(randrun(4).late(1).firstCycle()).toStrictEqual(sequence(1, 2, 0, 3).firstCycle());
});
});
describe('binaryN', () => {
it('Can make a binary pattern from a decimal', () => {