tests: test some errors of sqlite3
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 17 Jul 2014 18:09:16 +0000 (14:09 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 18 Jul 2014 17:02:07 +0000 (13:02 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

tests/sav/test_sqlite3_nity_alt1.res [new file with mode: 0644]
tests/sav/test_sqlite3_nity_alt2.res [new file with mode: 0644]
tests/test_sqlite3_nity.nit

diff --git a/tests/sav/test_sqlite3_nity_alt1.res b/tests/sav/test_sqlite3_nity_alt1.res
new file mode 100644 (file)
index 0000000..4aa3a13
--- /dev/null
@@ -0,0 +1,2 @@
+Runtime error: Assert failed (alt/test_sqlite3_nity_alt1.nit:27)
+unable to open database file
diff --git a/tests/sav/test_sqlite3_nity_alt2.res b/tests/sav/test_sqlite3_nity_alt2.res
new file mode 100644 (file)
index 0000000..8d75750
--- /dev/null
@@ -0,0 +1,2 @@
+Runtime error: Assert failed (alt/test_sqlite3_nity_alt2.nit:39)
+SQL logic error or missing database
index 02f238a..ea09f8c 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_sqlite3_nity
-
 import sqlite3
 
 var path = "test_nity.db"
+#alt1#path = "/../invalid_path.db"
 if path.file_exists then path.file_delete
 
 var db = new Sqlite3DB.open(path)
@@ -37,6 +36,10 @@ assert db.insert("INTO users VALUES('Guillaume', 'xxx', 1, 88.8)") else
        print db.error or else "no error?"
 end
 
+#alt2#assert db.insert("INTO notable VALUES('Alexis', 'asdf', 2, 99.9)") else
+#alt2# print db.error or else "no error?"
+#alt2#end
+
 for row in db.select("* FROM users") do
        print "####"