def test_extract_citations_basic(self):
        """Test basic citation extraction from text with standard format."""
        # Test function to extract citations
        def extract_citations(text):
            citation_pattern = r'\[([\w\d]+)\]'
            citations = re.findall(citation_pattern, text)
            return citations

        # Test cases
        test_cases = [
            (
                "Aristotle discussed virtue ethics in his Nicomachean Ethics [abc1234].",
                ["abc1234"]
            ),
            (
                "According to Plato [xyz5678] and Aristotle [abc1234], philosophy is important.",
                ["xyz5678", "abc1234"]
            ),
            (
                "This text has no citations.",
                []
            ),
            (
                "Multiple citations in a row [abc1234][def5678][ghi9012] should all be found.",
                ["abc1234", "def5678", "ghi9012"]
            )
        ]

        # Run tests
        for text, expected_citations in test_cases:
            extracted = extract_citations(text)
            assert extracted == expected_citations
Test basic citation extraction from text with standard format.
py/tests/unit/retrieval/test_citations.py