Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
diff tests/test_algpseudo.py @ 114:be50fe0687d6
The \CALL command
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 06 May 2026 01:10:11 +0200 |
| parents | 9aea2fd5f037 |
| children | e1663ac707b0 |
line wrap: on
line diff
--- a/tests/test_algpseudo.py Tue May 05 20:51:20 2026 +0200 +++ b/tests/test_algpseudo.py Wed May 06 01:10:11 2026 +0200 @@ -899,6 +899,36 @@ ], pygments.lex(r"a \gets 2.7", lexer)) + def test_call(self): + self.assertTokenStreamEqualComplete( + [("Name.Entity", "a function"), + ("Punctuation", "("), + ("Name.Entity", "p1"), + ("Punctuation", ","), + ("Text", " "), + ("Name.Entity", "p2"), + ("Punctuation", ")"), + ("Text.Whitespace", "\n"), + ], + pygments.lex(r"\CALL{a function}(p1, p2)", self.lexer)) + + def test_call_in_expr(self): + self.assertTokenStreamEqualComplete( + [("Name.Entity", "a procedure"), + ("Punctuation", "("), + ("Name.Entity", "arg1"), + ("Punctuation", ","), + ("Text", " "), + ("Name.Entity", "arg2"), + ("Punctuation", ","), + ("Text", " "), + ("Name.Entity", "arg3"), + ("Punctuation", ")"), + ("Text.Whitespace", "\n"), + ], + pygments.lex(r"\TEXT{\EXPR{\CALL{a procedure}(arg1, arg2, arg3)}}", + self.lexer)) + class PygmentizeCompletely(unittest.TestCase):
