From 9c695761a303b7cf1b37905bda3395ed60adeb30 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 23 Nov 2015 14:43:55 +0100 Subject: l/Pygments: Fix exception for filenames ending with a dot Signed-off-by: Florian Pritz --- application/test/tests/test_libraries_pygments.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'application/test') diff --git a/application/test/tests/test_libraries_pygments.php b/application/test/tests/test_libraries_pygments.php index 768bca439..d6bb559ee 100644 --- a/application/test/tests/test_libraries_pygments.php +++ b/application/test/tests/test_libraries_pygments.php @@ -80,7 +80,14 @@ class test_libraries_pygments extends \test\Test { { $p = new \libraries\Pygments('/invalid/filepath', 'image/svg+xml', 'foo.svg'); $this->t->is($p->can_highlight(), true, "image/svg+xml can highlight"); - } + } + + public function test_autodetect_lexer_strangeFilenames() + { + $p = new \libraries\Pygments('/invalid/filepath', 'text/plain', 'foo.'); + $this->t->is($p->autodetect_lexer(), 'text', "foo. should be text"); + + } } -- cgit v1.2.3-24-g4f1b