Skip to content

Commit b15bba9

Browse files
committed
test(split): verify that additional data is kept upon split
1 parent 4e12b9d commit b15bba9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/lib.test.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ test('intersection will not simplify when two intervals are touching', t => {
460460
testFnToIntervals(r2, r1, intersect, testOutputFn, t);
461461
});
462462

463-
464463
test('intersection will keep object properties', t => {
465464
const r1 = [{ start: 1, end: 5, test: 'foo' }];
466465
const r2 = [{ start: 1, end: 2, test: 'bar' }, { start: 2, end: 5, test: 'baz' }];
@@ -496,7 +495,6 @@ test('will split empty interval', t => {
496495
t.is(res.length, 0);
497496
});
498497

499-
500498
test('will not split when no indexes', t => {
501499
const r1 = [{ start: 0, end: 7, test: 'foo' }];
502500
const r2: number[] = [];
@@ -506,11 +504,11 @@ test('will not split when no indexes', t => {
506504
});
507505

508506
test('will not split when no intersection', t => {
509-
const r1 = [{ start: 0, end: 7, test: 'foo' }, { start: 8, end: 10 }];
507+
const r1 = [{ start: 0, end: 7, test: 'foo' }, { start: 8, end: 10, test: 'bar' }];
510508
const r2 = [9];
511509
const res = split(r2, r1);
512510
t.is(res.length, 3);
513511
testInterval(t, res[0], [0, 7], { test: 'foo' });
514-
testInterval(t, res[1], [8, 9]);
515-
testInterval(t, res[2], [9, 10]);
512+
testInterval(t, res[1], [8, 9], { test: 'bar' });
513+
testInterval(t, res[2], [9, 10], { test: 'bar' });
516514
});

0 commit comments

Comments
 (0)