summaryrefslogtreecommitdiff
path: root/tests/units/LexerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/LexerTest.php')
-rw-r--r--tests/units/LexerTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/units/LexerTest.php b/tests/units/LexerTest.php
index e2b97566..4d0d67ad 100644
--- a/tests/units/LexerTest.php
+++ b/tests/units/LexerTest.php
@@ -66,6 +66,31 @@ class LexerTest extends Base
);
}
+ public function testCategoryQuery()
+ {
+ $lexer = new Lexer;
+
+ $this->assertEquals(
+ array(array('match' => 'category:', 'token' => 'T_CATEGORY'), array('match' => 'Feature Request', 'token' => 'T_STRING')),
+ $lexer->tokenize('category:"Feature Request"')
+ );
+
+ $this->assertEquals(
+ array('T_CATEGORY' => array('Feature Request')),
+ $lexer->map($lexer->tokenize('category:"Feature Request"'))
+ );
+
+ $this->assertEquals(
+ array('T_CATEGORY' => array('Feature Request', 'Bug')),
+ $lexer->map($lexer->tokenize('category:"Feature Request" category:Bug'))
+ );
+
+ $this->assertEquals(
+ array(),
+ $lexer->map($lexer->tokenize('category: '))
+ );
+ }
+
public function testStatusQuery()
{
$lexer = new Lexer;