Fix mod() test for sqlite

This commit is contained in:
Worros 2009-11-19 17:33:12 +08:00
parent 33592fbc4e
commit ea323d0d22

View File

@ -53,14 +53,16 @@ def testSQLiteFloorFunction():
def testSQLiteModFunction(): def testSQLiteModFunction():
vars = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ,17, 18] vars = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ,17, 18]
cur.execute("CREATE TABLE test(i float)") cur.execute("CREATE TABLE test(i int)")
for var in vars: for var in vars:
cur.execute("INSERT INTO test(i) values(%i)" % var) cur.execute("INSERT INTO test(i) values(%i)" % var)
cur.execute("SELECT mod(i,13) from test") cur.execute("SELECT mod(i,13) from test")
result = cur.fetchall() result = cur.fetchall()
answer = 0 idx = 0
for i in result: for i in result:
print "DEBUG: int(var): %s" % i[0] print "DEBUG: int(var): %s" % i[0]
assert answer == i[0] assert vars[idx]%13 == int(i[0])
answer = answer + 1 idx = idx+1
assert 0 == 1
cur.execute("DROP TABLE test") cur.execute("DROP TABLE test")