from __future__ import annotations

from pathlib import Path

from scopewrit.perf import measure_policy_latency


def test_latency_harness_measures_both_paths(tmp_path: Path) -> None:
    report = measure_policy_latency(tmp_path / "latency", iterations=10)
    assert report["iterations_per_path"] == 10
    assert report["allow_ticket_consume"]["median_ms"] > 0
    assert report["default_deny"]["median_ms"] > 0
    assert (tmp_path / "latency" / "policy-latency.json").is_file()
