"""SP39 sibling-project test: ``regen_corrected_files`` produces
byte-correct output for the three shape variants (already-correct,
SKCO0-buggy, CO_BHA)."""
from __future__ import annotations

import sys
from pathlib import Path

import pytest

sys.path.insert(0, str(Path(__file__).parent))

from regen_corrected_files import _interchange_index_for  # noqa: E402


def test_interchange_index_for_global_counter():
    """The helper just adds 1000 — pin that to detect off-by-one
    drift if anyone tweaks the offset (it's the safety margin above
    the seeded ISA13 range in the test fixtures)."""
    assert _interchange_index_for(1) == 1001
    assert _interchange_index_for(363) == 1363
    assert _interchange_index_for(0) == 1000