import { test } from 'node:test' import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { fileURLToPath } from 'node:url' import { dirname, join } from 'node:path' /** * 跟价页「旧逐行派发」死代码守卫(2026-10-04 C 档收尾)。 * * processMatchedQueue 是循环派发(pushToPythonLoopQueue → runLoopExecution)之前的实现, * 入口只有 `if (autoQueueEnabled.value)`,而 autoQueueEnabled 在本页从来没被置 true ⇒ 永远进不去。 * 留着它不是无害死代码:它是一套能重复买提取的并行派发路径,谁接错一次就再花钱。 * 所以这里反向钉住"不得回流",而不是给死代码补测试。 */ const PAGE = join( dirname(fileURLToPath(import.meta.url)), '../src/pages/brand/components/BrandPriceTrackTab.vue', ) const source = readFileSync(PAGE, 'utf8') test('跟价页不再保留旧逐行派发队列及其开关', () => { for (const symbol of [ 'processMatchedQueue', 'nextMatchedQueueItem', 'autoQueueEnabled', 'queueWorkerRunning', ]) { assert.ok(!source.includes(symbol), `${symbol} 仍在跟价页:旧的重复派发路径没清干净`) } }) test('跟价页启动仍只接循环派发一条路径', () => { assert.match(source, /@click="pushToPythonLoopQueue"/, '启动按钮没接循环派发') assert.ok(source.includes('async function runLoopExecution('), '循环派发实现不见了') })