From a11e06d4906c2e1186779b42d5e87a17f66c50ea Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 9 Apr 2015 15:17:13 +0200 Subject: Fix mime2lexer failing when using pygments info Signed-off-by: Florian Pritz --- application/tests/test_libraries_pygments.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'application/tests/test_libraries_pygments.php') diff --git a/application/tests/test_libraries_pygments.php b/application/tests/test_libraries_pygments.php index ba2103e50..f88a4bcbd 100644 --- a/application/tests/test_libraries_pygments.php +++ b/application/tests/test_libraries_pygments.php @@ -32,6 +32,10 @@ class test_libraries_pygments extends Test { $p = new \libraries\Pygments('/invalid/filepath', 'application/x-php', 'stdin'); $this->t->is($p->autodetect_lexer(), 'php', "application/php should be php"); + // This is from pygments and not our hardcoded list + $p = new \libraries\Pygments('/invalid/filepath', 'text/x-pascal', 'stdin'); + $this->t->is($p->autodetect_lexer(), 'delphi', "text/x-pascal should be delphi"); + $p = new \libraries\Pygments('/invalid/filepath', 'application/octet-stream', 'stdin'); $this->t->is($p->autodetect_lexer(), false, "application/octet-stream should return false"); } -- cgit v1.2.3-24-g4f1b