import { describe, it, expect } from 'vitest';
import { _TARGET_RESOLVER_INTERNALS } from './target-resolver';

describe('WNP_REGEX', () => {
  const re = _TARGET_RESOLVER_INTERNALS.WNP_REGEX;

  it('matches the canonical 11-char Wulf Nurse pattern', () => {
    expect(re.test('YNGHYNWNP01')).toBe(true);
    expect(re.test('FOSSUPWNP02')).toBe(true);
    expect(re.test('TARBBPWNP09')).toBe(true);
  });

  it('case-insensitive on the literal portion', () => {
    expect(re.test('ynghynwnp01')).toBe(true);
  });

  it('rejects mismatched lengths or shapes', () => {
    expect(re.test('YNGHYNWNP1')).toBe(false); // 1 digit suffix
    expect(re.test('YNGHYNWNP123')).toBe(false); // 3 digit suffix
    expect(re.test('YNGHYNWN01')).toBe(false); // missing P
    expect(re.test('YNHYNWNP01')).toBe(false); // 5 letters before WNP
  });
});
