summaryrefslogtreecommitdiffstats
path: root/application/test/tests
diff options
context:
space:
mode:
Diffstat (limited to 'application/test/tests')
-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");
+ }
+
}