Commits

ltnooy  committed 6c14aa6 Draft

Fix issue with similar operations being corrupted when parsing.

  • Participants
  • Parent commits 4377ed6

Comments (0)

Files changed (2)

File pyrqlate/__init__.py

 
             rql = rql.replace(
                     u'%s%s%s' % (variable, op[0], value),
-                    u'%s(%s,%s)' % (op[1], variable, value)
+                    u'%s(%s,%s)' % (op[1], variable, value),
+                    1
                 )
 
             # Reset the search for the operator as the string has changed length.

File pyrqlate/tests/test.py

         self.assertEqual(pyrqlate.deparse(q), 'id=1|(name=eagle|age=1)')
 
     #---------------------------------------------------------------------------
+    def test_nearly_duplicate(self):
+        q = pyrqlate.parse('status=suggested|status=suggestedwinner')
+        self.assertEqual(pyrqlate.deparse(q), 'status=suggested|status=suggestedwinner')
+
+    #---------------------------------------------------------------------------
     def test_empty_parse(self):
         q = pyrqlate.parse('')
         self.assertEqual(pyrqlate.Query, type(q))