Commits

Daniel Lindsley committed 8730cf3

Added failing tests for query parsing.

Comments (0)

Files changed (1)

tests/test_parsing.py

         self.assertEqual(q.__class__, query.NumericRange)
         self.assertEqual(q.start, teststart)
         self.assertEqual(q.end, testend)
+        
+        # Broken from what I'd expect.
+        # Also yields a ``ValueError: Called make_binary_tree with empty list``
+        # when run against a real data set.
+        q = qp.parse("view_count:[1 TO 10]")
+        self.assertEqual(q.__class__, query.NumericRange)
+        self.assertEqual(q.start, 1)
+        self.assertEqual(q.end, 10)
+        self.assertEqual(q.fieldname, "name")
+    
+    def test_regressions(self):
+        qp = qparser.QueryParser("content")
+        
+        # From 0.3.18, these used to require escaping. Mostly good
+        # for regression testing.
+        q = qp.parse(u"re-inker")
+        q = qp.parse(u"0.7 wire")
+        q = qp.parse(u"daler-rowney pearlescent 'bell bronze'")
+        q = qp.parse(u'22" BX')
+        
+        # Sorry, dunno what these should all look like, so fail loudly.
+        self.fail()
     
     def test_empty_ranges(self):
         schema = fields.Schema(name=fields.TEXT, num=fields.NUMERIC,