Fix zero length queries WIP (#234)

* failing tests for zero-width queries

* support zero width timespans in splitArcs. Fixes one test, breaks a load more..

* fix fastGap
This commit is contained in:
Alex McLean 2022-10-29 23:23:10 +01:00 committed by GitHub
parent fbb3d144a1
commit 24328ee8ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 5 deletions

View file

@ -137,6 +137,9 @@ describe('Pattern', () => {
it('Can make a pattern', () => {
expect(pure('hello').query(st(0.5, 2.5)).length).toBe(3);
});
it('Supports zero-width queries', () => {
expect(pure('hello').queryArc(0,0).length).toBe(1);
});
});
describe('fmap()', () => {
it('Can add things', () => {
@ -430,6 +433,16 @@ describe('Pattern', () => {
// mini('[c3 g3]/2 eb3') always plays [c3 eb3]
// mini('eb3 [c3 g3]/2 ') always plays [c3 g3]
});
it('Supports zero-length queries', () => {
expect(steady('a')._slow(1).queryArc(0,0)
).toStrictEqual(steady('a').queryArc(0,0))
});
});
describe('slow()', () => {
it('Supports zero-length queries', () => {
expect(steady('a').slow(1)._setContext({}).queryArc(0,0)
).toStrictEqual(steady('a')._setContext({}).queryArc(0,0))
});
});
describe('inside', () => {
it('can rev inside a cycle', () => {