import assert from 'node:assert/strict' import test from 'node:test' import { isPlatformOrderIdLookupKeyword } from './platform-order-id.js' test('识别纯数字平台订单号', () => { assert.equal(isPlatformOrderIdLookupKeyword('20247230034021572'), true) assert.equal(isPlatformOrderIdLookupKeyword('123456'), true) assert.equal(isPlatformOrderIdLookupKeyword('12345'), false) }) test('识别拼多多带连字符的 order_sn', () => { assert.equal(isPlatformOrderIdLookupKeyword('260915-091435834962130'), true) assert.equal(isPlatformOrderIdLookupKeyword('260912-123456789012345'), true) }) test('拒绝普通关键词', () => { assert.equal(isPlatformOrderIdLookupKeyword('皮肤店'), false) assert.equal(isPlatformOrderIdLookupKeyword('安卓怒嚎3钻'), false) assert.equal(isPlatformOrderIdLookupKeyword('DT881aa66294cc'), false) assert.equal(isPlatformOrderIdLookupKeyword(''), false) })