summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-08-01 19:28:30 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-08-01 19:28:30 +0200
commit526996e59f781a5bf6752e48db51539fea4b5df2 (patch)
treefa35b96e863ffed8de4ad55a5514832cda75e963
parent90d017e2875f0104b837fb9da92fe1ddefc58873 (diff)
Test \libraries\Pygments
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/test/tests/test_libraries_pygments.php16
1 files changed, 16 insertions, 0 deletions
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");
+ }
+
}