test(FEAT-MO-005): 补充探针地址边界测试
This commit is contained in:
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict';
|
|||||||
import test from 'node:test';
|
import test from 'node:test';
|
||||||
import { spawnSync } from 'node:child_process';
|
import { spawnSync } from 'node:child_process';
|
||||||
|
|
||||||
import { analyzeTdxRows } from './market-structure-capability.mjs';
|
import { analyzeTdxRows, parseArguments } from './market-structure-capability.mjs';
|
||||||
|
|
||||||
test('帮助信息声明固定的本机数据源边界', () => {
|
test('帮助信息声明固定的本机数据源边界', () => {
|
||||||
const result = spawnSync(
|
const result = spawnSync(
|
||||||
@@ -28,3 +28,11 @@ test('TDX 列式序列在 Date 与 Amount 等长且分钟时间戳完整时标
|
|||||||
{ dateAmountAligned: true, timestampsIntraday: true },
|
{ dateAmountAligned: true, timestampsIntraday: true },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('探针拒绝非回环地址和错误端口', () => {
|
||||||
|
assert.throws(
|
||||||
|
() => parseArguments(['--base-url', 'http://192.168.1.10:8080']),
|
||||||
|
/127\.0\.0\.1:8080/,
|
||||||
|
);
|
||||||
|
assert.throws(() => parseArguments(['--base-url', 'http://127.0.0.1:9000']), /127\.0\.0\.1:8080/);
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user