[Commits] (twl) Add tests for
commits at osafoundation.org
commits at osafoundation.org
Thu Aug 26 17:28:43 PDT 2004
Commit by: twl
Modified files:
chandler/repository/query/parser/tests/TestParserGrammar.py 1.4 1.5
Log message:
Add tests for
testing enumerations
dates
fulltext / lucene
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/repository/query/parser/tests/TestParserGrammar.py.diff?r1=text&tr1=1.4&r2=text&tr2=1.5
Index: chandler/repository/query/parser/tests/TestParserGrammar.py
diff -u chandler/repository/query/parser/tests/TestParserGrammar.py:1.4 chandler/repository/query/parser/tests/TestParserGrammar.py:1.5
--- chandler/repository/query/parser/tests/TestParserGrammar.py:1.4 Mon Aug 23 19:06:24 2004
+++ chandler/repository/query/parser/tests/TestParserGrammar.py Thu Aug 26 17:28:41 2004
@@ -1,5 +1,5 @@
-__revision__ = "$Revision: 1.4 $"
-__date__ = "$Date: 2004/08/24 02:06:24 $"
+__revision__ = "$Revision: 1.5 $"
+__date__ = "$Date: 2004/08/27 00:28:41 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Founation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -147,6 +147,12 @@
['for', 'i', 'z', ['>', ['fn', 'len', [['path', ['z', 'messages'], None]]], '1000']]
>>> print parse('for_stmt', 'for i in "//Schema/Core/Kind" where i.hasAttributeValue("itsName")')
['for', 'i', '"//Schema/Core/Kind"', ['method', ['path', ['i', 'hasAttributeValue'], None], ['"itsName"']]]
+ >>> print parse('for_stmt', u"for i in '//parcels/osaf/contentmodel/calendar/CalendarEvent' where i.importance == 'fyi'")
+ ['for', u'i', u"'//parcels/osaf/contentmodel/calendar/CalendarEvent'", [u'==', ['path', [u'i', u'importance'], None], u"'fyi'"]]
+ >>> print parse('for_stmt', u"for i in '//parcels/osaf/contentmodel/calendar/CalendarEvent' where i.startTime > date('2004-08-01') and i.startTime < date('2004-08-01')")
+ ['for', u'i', u"'//parcels/osaf/contentmodel/calendar/CalendarEvent'", [u'and', [u'>', ['path', [u'i', u'startTime'], None], ['fn', u'date', [u"'2004-08-01'"]]], [u'<', ['path', [u'i', u'startTime'], None], ['fn', u'date', [u"'2004-08-01'"]]]]]
+ >>> print parse('for_stmt', u"for i in '//Schema/Core/Kind' where ftcontains(i.description,'\\"howard johnson\\" and pancakes')")
+ ['for', u'i', u"'//Schema/Core/Kind'", ['fn', u'ftcontains', [['path', [u'i', u'description'], None], u'\\'"howard johnson" and pancakes\\'']]]
### UNION_EXPR
>>> print parse('union_stmt','union(for i in "//parcels/osaf/contentmodel/calendar/CalendarEvent" where True, for i in "//parcels/osaf/contentmodel/Note" where True, for i in "//parcels/osaf/contentmodel/contacts/Contact" where True)')
More information about the Commits
mailing list