Merge pull request 'Add tests for randrun and negative time test for run' (#2098) from tzwaan/add-randrun-test into main

Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2098
This commit is contained in:
Alex McLean
2026-08-13 08:51:30 +02:00
+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', () => {