Updating built in Io code to use += instead of x = x + y
[io/quag.git] / addons / SQLite3 / tests / SQLite3Test.io
blob806c38c08176f8f9d5013d024b6350beba5c0205
1 SQLite3
3 SQLites3Test := UnitTest clone do(
4 type := "SQLite3Tests"
6 test_1_open := method(
7 self name := "myDatabase.sqlite3"
8 File clone setPath(name) remove
9 self db := SQLite3 clone
10 //db debugOn
11 db setPath(name)
12 db open
13 assertTrue(db isOpen)
16 test_2_create := method(
17 db exec("CREATE TABLE Dbm (key, value)")
18 db exec("CREATE INDEX DbmIndex ON Dbm (key)")
21 test_3_insert := method(
22 db exec("INSERT INTO Dbm ('key', 'value') VALUES ('a', '123')")
23 db exec("INSERT INTO Dbm ('key', 'value') VALUES ('a', 'efg')")
24 rows := db exec("SELECT key, value FROM Dbm WHERE key='a'")
25 assertEquals(rows size, 2)
28 test_3_delete := method(
29 db exec("DELETE FROM Dbm WHERE key='a'")
30 rows := db exec("SELECT key, value FROM Dbm WHERE key='a'")
31 assertEquals(rows size, 0)
34 test_4_close := method(
35 db close
36 assertFalse(db isOpen)
37 File clone setPath(db path) remove