]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/blobdiff - parser/test_parser.py
Allow 'NOT ' and 'not '
[phdru.name/cgi-bin/blog-ru/search-tags.git] / parser / test_parser.py
index c6d353e5f81f2f91afe8c6b60e29425dd64685e2..4696047338be02e8f749ebae22d5fb39b7e4f5cf 100755 (executable)
@@ -39,6 +39,12 @@ class TestParser(unittest.TestCase):
         self.assertEqual(parser.parse('xxx OR yyy'),
             ('OR', ('NAME', 'xxx'), ('NAME', 'yyy'))
         )
+        self.assertEqual(parser.parse('not xxx'),
+            ('NOT', ('NAME', 'xxx'))
+        )
+        self.assertEqual(parser.parse('NOT xxx'),
+            ('NOT', ('NAME', 'xxx'))
+        )
 
     def test_05_bad_expression(self):
         self.assertIs(parser.parse('!(xxx&yyy'), None)