From 526996e59f781a5bf6752e48db51539fea4b5df2 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 1 Aug 2016 19:28:30 +0200 Subject: Test \libraries\Pygments Signed-off-by: Florian Pritz --- application/test/tests/test_libraries_pygments.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/application/test/tests/test_libraries_pygments.php b/application/test/tests/test_libraries_pygments.php index 57c5d27fe..2e6e8447f 100644 --- a/application/test/tests/test_libraries_pygments.php +++ b/application/test/tests/test_libraries_pygments.php @@ -95,5 +95,21 @@ class test_libraries_pygments extends \test\Test { } + public function test_get_lexers() + { + $l = \libraries\Pygments::get_lexers(); + + $this->t->is($l['text'], 'Plain text', 'Plain text lexer exists'); + $this->t->is($l['c'], 'C', 'C lexer exists'); + } + + public function test_resolve_lexer_alias() + { + $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'foo.pl'); + $this->t->is($p->resolve_lexer_alias('pl'), 'perl', "Test pl alias for perl"); + + $this->t->is($p->resolve_lexer_alias('thisIsInvalid'), 'thisIsInvalid', "Test invalid alias"); + } + } -- cgit v1.2.3-24-g4f1b