def test_find_new_citation_spans(self):
        """Test the function that finds new citation spans in text."""
        tracker = CitationTracker()

        # First text with citations
        text = "This is a text with citation [abc1234]."
        new_spans1 = find_new_citation_spans(text, tracker)
        assert len(new_spans1) == 1, "Should find one new span"
        assert new_spans1[0][0] == "abc1234", "Citation ID should match"
        citation_id, start, end = new_spans1[0]
        assert citation_id in tracker.processed_spans, "Citation ID should be tracked"
        assert (start, end) in tracker.processed_spans[citation_id], "Span should be tracked"

        # Duplicate span in new text
        text2 = text  # Same text with same citation
        new_spans2 = find_new_citation_spans(text2, tracker)
        assert new_spans2 == [], "Should not find duplicate spans"

        # Text with new citation
        text3 = "This is another text with a new citation [def5678]."
        new_spans3 = find_new_citation_spans(text3, tracker)
        assert len(new_spans3) == 1, "Should find one new span"
        assert new_spans3[0][0] == "def5678", "New citation ID should match"

        # Text with both old and new citations
        text4 = "Text with both [abc1234] and [ghi9012]."
        new_spans4 = find_new_citation_spans(text4, tracker)
        assert len(new_spans4) == 1, "Should only find the new span"
        assert new_spans4[0][0] == "ghi9012", "Only new citation ID should be found"
Test the function that finds new citation spans in text.
py/tests/unit/retrieval/test_citations.py