--- a/schema.py Fri Jul 01 15:23:25 2011 +0200
+++ b/schema.py Fri Jul 01 15:26:12 2011 +0200
@@ -645,9 +645,10 @@
def split_expression(rqlstring):
for expr in rqlstring.split(','):
- for noparen in expr.split('('):
- for word in noparen.split():
- yield word
+ for noparen1 in expr.split('('):
+ for noparen2 in noparen1.split(')'):
+ for word in noparen2.split():
+ yield word
def normalize_expression(rqlstring):
"""normalize an rql expression to ease schema synchronization (avoid
--- a/test/unittest_schema.py Fri Jul 01 15:23:25 2011 +0200
+++ b/test/unittest_schema.py Fri Jul 01 15:26:12 2011 +0200
@@ -315,8 +315,8 @@
class GuessRrqlExprMainVarsTC(TestCase):
def test_exists(self):
- mainvars = guess_rrqlexpr_mainvars(normalize_expression('NOT EXISTS(O team_competition C, C level < 3)'))
- self.assertEqual(mainvars, set(['O']))
+ mainvars = guess_rrqlexpr_mainvars(normalize_expression('NOT EXISTS(O team_competition C, C level < 3, C concerns S)'))
+ self.assertEqual(mainvars, set(['S', 'O']))
if __name__ == '__main__':