import sys import unittest from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[1])) from shadow_benchmark import compare_shadow_outputs from temporal_chord_metrics import ChordInterval class ShadowBenchmarkTests(unittest.TestCase): def test_ranqueia_provider_sem_promover_runtime(self): reference = [ChordInterval(0, 1, "C"), ChordInterval(1, 2, "G")] result = compare_shadow_outputs( reference, { "current": [ChordInterval(0, 2, "C")], "candidate": [ChordInterval(0, 1, "C"), ChordInterval(1, 2, "G")], }, ) self.assertEqual(result["winner"], "candidate") self.assertEqual(result["ranking"], ["candidate", "current"]) self.assertEqual(result["providers"]["candidate"]["exact_wcsr"], 1.0) if __name__ == "__main__": unittest.main()