"""every oracle must accept its reference solution — else the eval is meaningless.

needs `zig` on PATH; skips cleanly if absent.
"""

import shutil

import pytest

from zigman_eval.tasks import TASKS, validate_oracles

pytestmark = pytest.mark.skipif(shutil.which("zig") is None, reason="zig not on PATH")


@pytest.mark.parametrize("row", validate_oracles() if shutil.which("zig") else [], ids=lambda r: r[0].id)
def test_oracle_accepts_reference(row):
    task, ok, detail = row
    assert ok, f"oracle for {task.id} rejected its reference solution: {detail}"


def test_corpus_nonempty():
    assert len(TASKS) >= 1
