From 2e4aa59540392e40168a6d83c858edd8514ba086 Mon Sep 17 00:00:00 2001 From: Nathan Bird Date: Tue, 19 Jan 2010 15:28:01 -0500 Subject: [PATCH] Adding new connection tests that are the simplest query/command against a database connection. 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 | 19 +++++++++++++++++++ tests/test-fdml.lisp | 13 ------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/tests/test-connection.lisp b/tests/test-connection.lisp index 86c79c3..25c8b73 100644 --- a/tests/test-connection.lisp +++ b/tests/test-connection.lisp @@ -36,4 +36,23 @@ "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) + )) diff --git a/tests/test-fdml.lisp b/tests/test-fdml.lisp index 053dbc4..9bacbe5 100644 --- a/tests/test-fdml.lisp +++ b/tests/test-fdml.lisp @@ -124,19 +124,6 @@ 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 -- 2.34.1