def test_core_citation_tracker_edge_cases(self):
        """Test edge cases for the core CitationTracker class."""
        tracker = CitationTracker()

        # Test with empty or invalid inputs
        assert not tracker.is_new_span("", (10, 20)), "Empty citation ID should not be tracked"
        assert not tracker.is_new_span(None, (10, 20)), "None citation ID should not be tracked"
        assert tracker.is_new_span("abc1234", (-5, 20)), "Negative start position should be accepted"
        assert tracker.is_new_span("abc1234", (30, 20)), "End before start should be accepted (implementation dependent)"

        # Test overlapping spans
        assert tracker.is_new_span("def5678", (10, 30)), "First overlapping span should be new"
        assert tracker.is_new_span("def5678", (20, 40)), "Second overlapping span should be new"
        assert len(tracker.processed_spans["def5678"]) == 2, "Both overlapping spans should be recorded"

        # Test with very large spans
        assert tracker.is_new_span("large", (0, 10000)), "Very large span should be tracked"
        assert (0, 10000) in tracker.processed_spans["large"], "Large span should be recorded correctly"

        # Test get_all_spans with multiple citations
        all_spans = tracker.get_all_citation_spans()
        assert len(all_spans) >= 3, "Should have at least 3 different citation IDs"
        # Empty citation ID won't be included since we properly reject them in is_new_span
Test edge cases for the core CitationTracker class.
py/tests/unit/retrieval/test_citations.py