llm-semantic-visualizer / tests /threadLabelFormat.test.js
hbauzan's picture
fix(arithmetic): lay out threads as WORD_A→B→C→RES→TOP1
88af80a
Raw
History Blame Contribute Delete
962 Bytes
import { describe, it, expect } from 'vitest';
import {
ARITHMETIC_THREAD_ORDER,
arithmeticSequenceIndex,
arithmeticThreadLabel,
} from '../src/ui/threadLabelFormat.js';
describe('threadLabelFormat', () => {
it('exposes arithmetic short labels', () => {
expect(arithmeticThreadLabel('A')).toBe('WORD_A');
expect(arithmeticThreadLabel('B')).toBe('WORD_B');
expect(arithmeticThreadLabel('C')).toBe('WORD_C');
expect(arithmeticThreadLabel('RES')).toBe('RES');
expect(arithmeticThreadLabel('TOP1')).toBe('TOP1');
});
it('orders slots WORD_A → WORD_B → WORD_C → RES → TOP1', () => {
expect(ARITHMETIC_THREAD_ORDER).toEqual(['A', 'B', 'C', 'RES', 'TOP1']);
expect(arithmeticSequenceIndex('A')).toBe(0);
expect(arithmeticSequenceIndex('B')).toBe(1);
expect(arithmeticSequenceIndex('C')).toBe(2);
expect(arithmeticSequenceIndex('RES')).toBe(3);
expect(arithmeticSequenceIndex('TOP1')).toBe(4);
});
});