Skip to content

Commit 89f4ab0

Browse files
🧪 test: Do not pull source in fixtures.
1 parent bc858a3 commit 89f4ab0

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

test/src/_fixtures.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import {reversed} from '@iterable-iterator/reversed';
44

55
import {Measures} from '@functional-abstraction/measure';
66

7-
import {empty} from '../../src/index.js';
8-
97
export const ABSTRACT_COUNTER = Measures.COUNTER;
108

119
export const FAST_COUNTER = {
@@ -45,14 +43,12 @@ export const fromLeftToString = (measure, iterable) =>
4543
export const fromRightToString = (measure, iterable) =>
4644
`fromRight(${measureToString(measure)}, ${iterableToString(iterable)})`;
4745

48-
export const fromLeft = (M, iterable) => {
49-
let tree = empty(M);
46+
export const fromLeft = (tree, iterable) => {
5047
for (const x of iterable) tree = tree.push(x);
5148
return tree;
5249
};
5350

54-
export const fromRight = (M, iterable) => {
55-
let tree = empty(M);
51+
export const fromRight = (tree, iterable) => {
5652
for (const x of reversed(iterable)) tree = tree.cons(x);
5753
return tree;
5854
};

test/src/regression/digit/nodes/generated.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import {
1111
fromRightToString as fr,
1212
} from '../../../_fixtures.js';
1313

14+
import {empty} from '../../../../../src/index.js';
15+
1416
const flfr = (t, M, A, B) => {
15-
const left = fromLeft(M, A);
16-
const right = fromRight(M, B);
17+
const left = fromLeft(empty(M), A);
18+
const right = fromRight(empty(M), B);
1719
const tree = left.concat(right);
1820
const expected = Array.from(A).concat(Array.from(B));
1921
t.is(tree.measure(), expected.length);
@@ -23,8 +25,8 @@ const flfr = (t, M, A, B) => {
2325
flfr.title = (title, M, A, B) => title ?? `${fl(M, A)}.concat(${fr(M, B)})`;
2426

2527
const flifrt = (t, M, A, B) => {
26-
const left = fromLeft(M, A).init();
27-
const right = fromRight(M, B).tail();
28+
const left = fromLeft(empty(M), A).init();
29+
const right = fromRight(empty(M), B).tail();
2830
const tree = left.concat(right);
2931
const expected = Array.from(A).slice(0, -1).concat(Array.from(B).slice(1));
3032
t.is(tree.measure(), expected.length);

0 commit comments

Comments
 (0)