cleaning up patches, and fixing missing pkey bugs in sqlite3
[clsql.git] / tests / test-fddl.lisp
index ed25a04d2b9a65a396d5aa4b8064cd6b2b7086a0..f7fb89bed93d967a22513277926f6f76e5d63b61 100644 (file)
@@ -16,8 +16,7 @@
 
 
 (in-package #:clsql-tests)
-
-#.(clsql:locally-enable-sql-reader-syntax)
+(clsql-sys:file-enable-sql-reader-syntax)
 
 (def-dataset *ds-fddl*
   (:setup (lambda ()
@@ -45,9 +44,11 @@ B varchar(32))")
 ;; list current tables
 (deftest :fddl/table/1
     (with-dataset *ds-fddl*
-      (sort (mapcar #'string-downcase
-                   (clsql:list-tables ))
-           #'string<))
+      (let ((tables (sort (mapcar #'string-downcase (clsql:list-tables))
+                          #'string<)))
+        ;; sqlite has a table for autoincrement sequences that we dont care about if
+        ;; it exists
+        (remove "sqlite_sequence" tables :test #'string-equal)))
   ("alpha" "bravo"))
 
 ;; create a table, test for its existence, drop it and test again
@@ -169,12 +170,14 @@ B varchar(32))")
     (with-dataset *ds-fddl*
       (multiple-value-bind (type length scale nullable)
          (clsql:attribute-type [c] [alpha])
-       (values (clsql-sys:in type :varchar :varchar2) length scale nullable)))
+       (values (clsql-sys:in type :varchar :varchar2 :nvarchar)
+                length scale nullable)))
   t 30 nil 1)
 
 (deftest :fddl/attributes/5
     (with-dataset *ds-fddl*
-      (and (member (clsql:attribute-type [d] [alpha]) '(:datetime :timestamp :date)) t))
+      (and (member (clsql:attribute-type [d] [alpha])
+                   '(:datetime :timestamp :date :smalldatetime)) t))
   t)
 
 (deftest :fddl/attributes/6
@@ -449,5 +452,3 @@ B varchar(32))")
   (nil (t nil) t (t nil)))
 
   ))
-
-#.(clsql:restore-sql-reader-syntax-state)