import os,sys


from Ft.Ods.Parsers.Oql import OqlParseTreeTuple


g_tests = [('select * from students as s where s.name = "Mike" and s.age = 25',""),
           ('select * from students as s where s.name = "Mike Olson"',""),
           ('select * from persons as p where p.name = "Mike Olson"',""),
           ]



def TestStatement(tester,stmt,expected):
    p = OqlParseTreeTuple.OqlParseTreeTuple()
    res = p.parse(stmt)
    #NOTE very difficult to test the results

def Test(tester):

    tester.startGroup("OQL Parser")



    for stmt,expected in g_tests:
        tester.startTest(stmt)
        TestStatement(tester,stmt,expected)
        tester.testDone()

    tester.groupDone()


if __name__ == '__main__':
    from Ft.Lib import TestSuite
    tester = TestSuite.TestSuite(1, 1)
    from Ft.Ods.StorageManager import Adapters
    tester.ods_driver_name = Adapters.g_driverName

    retVal = Test(tester)
    sys.exit(retVal)

