diff options
author | Bob Tolbert <bob@tolbert.org> | 2013-09-08 15:58:19 -0600 |
---|---|---|
committer | Bob Tolbert <bob@tolbert.org> | 2013-09-08 15:58:19 -0600 |
commit | 846195f0fb24e724a611d601494fa5056936b5bc (patch) | |
tree | 65df35ce1d501c24d46d46f19e424ad3ee25f428 /tests/test_examplefiles.py | |
parent | 1ea0fa53d253eae501f0a48611dd01493240b34d (diff) | |
download | pygments-846195f0fb24e724a611d601494fa5056936b5bc.tar.gz |
Added lexer for new Hy language, a variant of Lisp running
on Python. See: http://hylang.org
Note that this shares a file extension with the Hybris language
but the analyse_text() function does a good job of making the
distinction.
This did however require one change to the tests to actually
pass the code of the test file to get_lexer_for_filename()
so that the tests would differentiate Hy from Hybris.
And while this is a Lisp and shares some syntax with Clojure,
it has been added to the agile.py file to share the lists of
keywords and builtins with the PythonLexer.
Diffstat (limited to 'tests/test_examplefiles.py')
-rw-r--r-- | tests/test_examplefiles.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_examplefiles.py b/tests/test_examplefiles.py index d785cf3b..c3e3b2f7 100644 --- a/tests/test_examplefiles.py +++ b/tests/test_examplefiles.py @@ -31,10 +31,13 @@ def test_example_files(): absfn = os.path.join(testdir, 'examplefiles', fn) if not os.path.isfile(absfn): continue + + code = open(absfn).read() + outfn = os.path.join(outdir, fn) try: - lx = get_lexer_for_filename(absfn) + lx = get_lexer_for_filename(absfn, code=code) except ClassNotFound: if "_" not in fn: raise AssertionError('file %r has no registered extension, ' |