diff options
Diffstat (limited to 'tests/test_lexers_other.py')
-rw-r--r-- | tests/test_lexers_other.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/test_lexers_other.py b/tests/test_lexers_other.py index 7457d045..bb667c05 100644 --- a/tests/test_lexers_other.py +++ b/tests/test_lexers_other.py @@ -6,14 +6,12 @@ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ - import glob import os import unittest from pygments.lexers import guess_lexer -from pygments.lexers.scripting import RexxLexer - +from pygments.lexers.scripting import EasytrieveLexer, JclLexer, RexxLexer def _exampleFilePath(filename): return os.path.join(os.path.dirname(__file__), 'examplefiles', filename) @@ -36,7 +34,24 @@ class AnalyseTextTest(unittest.TestCase): self.assertEqual(guessedLexer.name, lexer.name) def testCanRecognizeAndGuessExampleFiles(self): - self._testCanRecognizeAndGuessExampleFiles(RexxLexer) + LEXERS_TO_TEST = [ + EasytrieveLexer, + JclLexer, + RexxLexer, + ] + for lexerToTest in LEXERS_TO_TEST: + self._testCanRecognizeAndGuessExampleFiles(lexerToTest) + + +class EasyTrieveLexerTest(unittest.TestCase): + def testCanGuessFromText(self): + self.assertLess(0, EasytrieveLexer.analyse_text('MACRO')) + self.assertLess(0, EasytrieveLexer.analyse_text('\nMACRO')) + self.assertLess(0, EasytrieveLexer.analyse_text(' \nMACRO')) + self.assertLess(0, EasytrieveLexer.analyse_text(' \n MACRO')) + self.assertLess(0, EasytrieveLexer.analyse_text('*\nMACRO')) + self.assertLess(0, EasytrieveLexer.analyse_text( + '*\n *\n\n \n*\n MACRO')) class RexxLexerTest(unittest.TestCase): |