Skip to content

Commit 941dbd5

Browse files
committed
test: 💍 fixup all tests
1 parent cc166d9 commit 941dbd5

File tree

5 files changed

+123
-581
lines changed

5 files changed

+123
-581
lines changed

src/util/diff/__tests__/arr.spec.ts

Lines changed: 0 additions & 298 deletions
This file was deleted.

src/util/diff/__tests__/line-fuzzer.spec.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
import {RandomJson} from '@jsonjoy.com/util/lib/json-random';
2-
import * as line from '../line';
3-
4-
const assertDiff = (src: string[], dst: string[]) => {
5-
const diff = line.diff(src, dst);
6-
const res: string[] = [];
7-
for (let [type, srcIdx, dstIdx, patch] of diff) {
8-
if (type === line.LINE_PATCH_OP_TYPE.DEL) {
9-
} else if (type === line.LINE_PATCH_OP_TYPE.INS) {
10-
res.push(dst[dstIdx]);
11-
} else if (type === line.LINE_PATCH_OP_TYPE.EQL) {
12-
res.push(src[srcIdx]);
13-
} else if (type === line.LINE_PATCH_OP_TYPE.MIX) {
14-
res.push(dst[dstIdx]);
15-
}
16-
}
17-
expect(res).toEqual(dst);
18-
};
2+
import {assertDiff} from './line';
193

204
const iterations = 1000;
215
const minElements = 2;

0 commit comments

Comments
 (0)