summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAmr Hesham <amr96@programmer.net>2023-03-07 11:15:03 +0200
committerGitHub <noreply@github.com>2023-03-07 10:15:03 +0100
commitfce7d0a2dd58046b6d48aff7e6c7059c90d0ac22 (patch)
treed3d1dec5dbc18dd462b0d2e853f8c89e21831850 /tests
parente61ffd96840c8a04b0556746fcfe8d7704ef6780 (diff)
downloadpygments-git-fce7d0a2dd58046b6d48aff7e6c7059c90d0ac22.tar.gz
Improve number regex and add lexer guess for carbon syntax (#2370)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_guess.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_guess.py b/tests/test_guess.py
index 8adf1613..30a0d977 100644
--- a/tests/test_guess.py
+++ b/tests/test_guess.py
@@ -169,6 +169,22 @@ def test_guess_c_lexer():
lexer = guess_lexer(code)
assert lexer.__class__.__name__ == 'CLexer'
+def test_guess_carbon_lexer():
+ code = '''
+ package Sorting api;
+
+ abstract class C {
+ var a: i32;
+ }
+
+ base class B {
+ var value_b: i32;
+ }
+
+ impl JustX as X {}
+ '''
+ lexer = guess_lexer(code)
+ assert lexer.__class__.__name__ == 'CarbonLexer'
def test_cbmbasicv2_analyse_text():
text = "10 PRINT \"PART 1\""