summaryrefslogtreecommitdiff
path: root/tests/test_cmdline.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-01-17 11:18:17 +0100
committerGeorg Brandl <georg@python.org>2021-01-17 11:18:17 +0100
commitb4594169025485f7d64d5ffd71f42673e7a5972d (patch)
treee5307a559bfde2a5f317d416180193acf86980f4 /tests/test_cmdline.py
parent7e6dbb20ce189022f1b0a058f44bd1c0b9d529a5 (diff)
downloadpygments-git-b4594169025485f7d64d5ffd71f42673e7a5972d.tar.gz
Added `pygmentize -C` option to guess a lexer from content
Diffstat (limited to 'tests/test_cmdline.py')
-rw-r--r--tests/test_cmdline.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index d740fccb..731729d9 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -220,6 +220,13 @@ def test_N_opt():
assert 'text' == o.strip()
+def test_C_opt():
+ o = check_success('-C', stdin='#!python3\n')
+ assert 'python' == o.strip()
+ o = check_success('-C', stdin='x')
+ assert 'text' == o.strip()
+
+
def test_invalid_opts():
for opts in [
('-X',),