Update test framework: fix run_tests.py to support all test files, add auto-import-check for test files

This commit is contained in:
qiaoxinjiu
2026-05-09 15:11:30 +08:00
parent eb053a347f
commit eaba8328da
21739 changed files with 2236758 additions and 719 deletions

17
node_modules/jsondiffpatch/lib/contexts/context.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import type { Options } from '../types.js';
export default abstract class Context<TResult> {
abstract pipe: string;
result?: TResult;
hasResult?: boolean;
exiting?: boolean;
parent?: this;
childName?: string | number;
root?: this;
options?: Options;
children?: this[];
nextAfterChildren?: this | null;
next?: this | null;
setResult(result: TResult): this;
exit(): this;
push(child: this, name?: string | number): this;
}

30
node_modules/jsondiffpatch/lib/contexts/context.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
export default class Context {
setResult(result) {
this.result = result;
this.hasResult = true;
return this;
}
exit() {
this.exiting = true;
return this;
}
push(child, name) {
child.parent = this;
if (typeof name !== 'undefined') {
child.childName = name;
}
child.root = this.root || this;
child.options = child.options || this.options;
if (!this.children) {
this.children = [child];
this.nextAfterChildren = this.next || null;
this.next = child;
}
else {
this.children[this.children.length - 1].next = child;
this.children.push(child);
}
child.next = this;
return this;
}
}

14
node_modules/jsondiffpatch/lib/contexts/diff.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import Context from './context.js';
import type { Delta } from '../types.js';
declare class DiffContext extends Context<Delta> {
left: unknown;
right: unknown;
pipe: 'diff';
leftType?: string;
rightType?: string;
leftIsArray?: boolean;
rightIsArray?: boolean;
constructor(left: unknown, right: unknown);
setResult(result: Delta): this;
}
export default DiffContext;

25
node_modules/jsondiffpatch/lib/contexts/diff.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import Context from './context.js';
import defaultClone from '../clone.js';
class DiffContext extends Context {
constructor(left, right) {
super();
this.left = left;
this.right = right;
this.pipe = 'diff';
}
setResult(result) {
if (this.options.cloneDiffValues && typeof result === 'object') {
const clone = typeof this.options.cloneDiffValues === 'function'
? this.options.cloneDiffValues
: defaultClone;
if (typeof result[0] === 'object') {
result[0] = clone(result[0]);
}
if (typeof result[1] === 'object') {
result[1] = clone(result[1]);
}
}
return super.setResult(result);
}
}
export default DiffContext;

10
node_modules/jsondiffpatch/lib/contexts/patch.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import Context from './context.js';
import type { Delta } from '../types.js';
declare class PatchContext extends Context<unknown> {
left: unknown;
delta: Delta;
pipe: 'patch';
nested?: boolean;
constructor(left: unknown, delta: Delta);
}
export default PatchContext;

10
node_modules/jsondiffpatch/lib/contexts/patch.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import Context from './context.js';
class PatchContext extends Context {
constructor(left, delta) {
super();
this.left = left;
this.delta = delta;
this.pipe = 'patch';
}
}
export default PatchContext;

10
node_modules/jsondiffpatch/lib/contexts/reverse.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import Context from './context.js';
import type { Delta } from '../types.js';
declare class ReverseContext extends Context<Delta> {
delta: Delta;
pipe: 'reverse';
nested?: boolean;
newName?: `_${number}`;
constructor(delta: Delta);
}
export default ReverseContext;

9
node_modules/jsondiffpatch/lib/contexts/reverse.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import Context from './context.js';
class ReverseContext extends Context {
constructor(delta) {
super();
this.delta = delta;
this.pipe = 'reverse';
}
}
export default ReverseContext;