from __future__ import annotations

import unittest

from reliability_core.harness import run_repeated


class RepetitionTests(unittest.TestCase):
    def test_eval_03_twenty_scenarios_three_repetitions(self) -> None:
        rows = run_repeated()
        improved = [row for row in rows if row["version"] == "A4"]
        self.assertEqual(len(improved), 60)
        self.assertEqual(len({row["test_id"] for row in improved}), 20)
        self.assertTrue(all(row["passed"] for row in improved))
        self.assertEqual(sum(row["duplicate_side_effects"] for row in improved), 0)
        self.assertEqual(sum(row["policy_violations"] for row in improved), 0)


if __name__ == "__main__":
    unittest.main()
