[Checkins] SVN: Sandbox/adamg/ocql/trunk/src/ocql/parser/parser.txt add tests to improve coverage

Charith Paranaliyanage paranaliyanage at gmail.com
Tue Aug 19 04:22:43 EDT 2008


Log message for revision 89996:
  add tests to improve coverage

Changed:
  U   Sandbox/adamg/ocql/trunk/src/ocql/parser/parser.txt

-=-
Modified: Sandbox/adamg/ocql/trunk/src/ocql/parser/parser.txt
===================================================================
--- Sandbox/adamg/ocql/trunk/src/ocql/parser/parser.txt	2008-08-19 08:09:05 UTC (rev 89995)
+++ Sandbox/adamg/ocql/trunk/src/ocql/parser/parser.txt	2008-08-19 08:22:42 UTC (rev 89996)
@@ -38,9 +38,12 @@
     >>> QueryParser("len ( list [ i in ICourse | i ] )")(None)
     Count(Query(<type 'list'>, In(Identifier(i), Identifier(ICourse)), Identifier(i)))
 
-    #FAILS, see raise "Help"
-    #>>> QueryParser("set [ d in IDepartments; every set [ c in ICourse; some c.runBy == d | c.credits ] == 2 | d.name ]")(None)
-
+    >>> QueryParser("set [ d in IDepartments; every set [ c in ICourse; some c.runBy == d | c.credits ] == 2 | d.name ]")(None)
+    Query(<type 'set'>, In(Identifier(d), Identifier(IDepartments));
+    Eq((Every, Query(<type 'set'>, In(Identifier(c), Identifier(ICourse)); 
+    Eq((Some, Property(Identifier(c), Identifier(runBy))), Identifier(d)), Property(Identifier(c), Identifier(credits)))), 
+    Constant(2)), Property(Identifier(d), Identifier(name)))
+    
     >>> QueryParser("set [ c in ICourse; c.credits > 3 | c.code ]")(None)
     Query(<type 'set'>, In(Identifier(c), Identifier(ICourse)); Gt(Property(Identifier(c), Identifier(credits)), Constant(3)), Property(Identifier(c), Identifier(code)))
 
@@ -61,3 +64,6 @@
 
     >>> QueryParser("set [ c in ICourse; a as c.code | a]")(None)
     Query(<type 'set'>, In(Identifier(c), Identifier(ICourse)); Alias(Identifier(a), Property(Identifier(c), Identifier(code))), Identifier(a))
+
+    >>> QueryParser("set [ c in ICourse; c.code==2  or c.code==3 | c ]")(None)
+    Query(<type 'set'>, In(Identifier(c), Identifier(ICourse)); Or(Eq(Property(Identifier(c), Identifier(code)), Constant(2)), Eq(Property(Identifier(c), Identifier(code)), Constant(3))), Identifier(c))



More information about the Checkins mailing list