Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / test_sqlite3_nity.nit
index 02f238a..42df219 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 "####"
 
@@ -55,6 +58,17 @@ for row in db.select("* FROM users") do
        print row[3].to_f
 end
 
+print "\nMap test:\n"
+
+for row in db.select("* FROM users") do
+       var m = row.map
+       print "####"
+       for k, v in m do
+               print "{k} = {v or else "nil"}"
+       end
+end
+print ""
+
 print db.is_open
 db.close
 print db.is_open