Adding new connection tests that are the simplest query/command against a database...
authorNathan Bird <nathan@acceleration.net>
Tue, 19 Jan 2010 20:28:01 +0000 (15:28 -0500)
committerNathan Bird <nathan@acceleration.net>
Mon, 1 Feb 2010 16:51:03 +0000 (11:51 -0500)
Dropping test :fdml/execute-command/1 everything is tested elsewhere.
table-exists-p - :fddl/table/2
execute-command - :connection/execute-command

tests/test-connection.lisp
tests/test-fdml.lisp

index 86c79c3e6282b35bd0accaba43da1ed760b52ccd..25c8b733c38f76b6f2d7162d5659071c0b4be7ba 100644 (file)
      "dbname/user@hostname")
   ("hostname" "dbname" "user"))
 
+(deftest :connection/execute-command
+    ;;check that we can issue basic commands.
+    (values
+      (clsql-sys:execute-command "CREATE TABLE DUMMY (foo integer)")
+      (clsql-sys:execute-command "DROP TABLE DUMMY"))
+  nil nil)
+
+(deftest :connection/query
+    ;;check that we can do a basic query
+    (first (clsql:query "SELECT 1" :flatp t :field-names nil))
+  1)
+
+(deftest :connection/query-command
+    ;;queries that are commands (no result set) shouldn't cause breakage
+    (values
+      (clsql-sys:query "CREATE TABLE DUMMY (foo integer)")
+      (clsql-sys:query "DROP TABLE DUMMY"))
+  nil nil)
+
 ))
index 053dbc45f7c02a0a9ee0304663ed1b3d7f96443a..9bacbe52024dc7abf5e35e57fbe08ed28d06e4f6 100644 (file)
   t (2 3 4 5 6 7 8 9 10))
 
 
-(deftest :fdml/execute-command/1
-    (with-dataset *ds-employees*
-      (values
-       (clsql:table-exists-p [foo] :owner *test-database-user*)
-       (progn
-         (clsql:execute-command "create table foo (bar integer)")
-         (clsql:table-exists-p [foo] :owner *test-database-user*))
-       (progn
-         (clsql:execute-command "drop table foo")
-         (clsql:table-exists-p [foo] :owner *test-database-user*))))
-  nil t nil)
-
-
 ;; compare min, max and average hieghts in inches (they're quite short
 ;; these guys!)
 (deftest :fdml/select/1