execl问题修复
This commit is contained in:
@@ -228,6 +228,40 @@ test('shared-child batch input compiles the inclusive cross-month range without
|
||||
});
|
||||
});
|
||||
|
||||
test('passenger TSV preserves 13 columns when the final passenger has empty optional fields', async () => {
|
||||
for (const route of [routeCases[5], routeCases[6]]) {
|
||||
for (const emptyPhone of [false, true]) {
|
||||
const rows = Array.from({ length: 19 }, (_, i) => {
|
||||
const cells = row.split('\t');
|
||||
cells[0] = String(i + 1);
|
||||
cells[12] = i === 0 ? '领队' : '';
|
||||
if (emptyPhone && i === 18) cells[11] = '';
|
||||
return cells.join('\t');
|
||||
});
|
||||
const text = `${headers}\n${rows.join('\n')}`;
|
||||
for (const crlf of [false, true]) {
|
||||
const input = `${route.input.replace(row, rows.join('\n'))}\n\n`;
|
||||
const result = await parseProgramInput({ rawText: crlf ? input.replace(/\n/g, '\r\n') : input, receivedAt });
|
||||
assert.equal(result.status, 'agent_parse_passed', JSON.stringify(result));
|
||||
const roster = (result.operation as any).data.passenger_list;
|
||||
assert.equal(roster.row_count, 19);
|
||||
assert.equal(roster.text, text);
|
||||
assert.deepEqual(roster.leader_contact, { sequence: 1, name: '测试游客', phone: '13800000001' });
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('passenger TSV rejects actual 12-column and 14-column data rows', async () => {
|
||||
const cells = row.split('\t');
|
||||
for (const malformed of [cells.slice(0, 12).join('\t'), `${cells.join('\t')}\t`]) {
|
||||
const result = await parseProgramInput({ rawText: routeCases[5].input.replace(row, malformed), receivedAt });
|
||||
assert.equal(result.status, 'agent_parse_needs_input');
|
||||
assert.equal(result.error_code, 'program_invalid_value');
|
||||
assert.match(String(result.reply), /13 列/);
|
||||
}
|
||||
});
|
||||
|
||||
test('passenger TSV promotes only an exact leader remark into structured ERP contact data', async () => {
|
||||
const leaderRow = '1\t测试领队\tLEADER TEST\t男\t1980-01-01\t湖南\t护照\tE90000001\t中国\t2025-01-01\t2035-01-01\t13800000001\t 领队 ';
|
||||
const exact = await parseProgramInput({
|
||||
|
||||
Reference in New Issue
Block a user