File size: 962 Bytes
c1dcee7
88af80a
 
 
 
 
c1dcee7
 
 
 
 
 
 
 
 
88af80a
 
 
 
 
 
 
 
 
c1dcee7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
  });
});