X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-connection.lisp;h=25c8b733c38f76b6f2d7162d5659071c0b4be7ba;hb=d22f943ae95f7421218d74e68179b773c63c0635;hp=6c3bc97d6d4316ae75386f13b8e41f51d1a87686;hpb=650466772f9eefbafd68fa66a4f5e5b4efd14c3a;p=clsql.git diff --git a/tests/test-connection.lisp b/tests/test-connection.lisp index 6c3bc97..25c8b73 100644 --- a/tests/test-connection.lisp +++ b/tests/test-connection.lisp @@ -36,17 +36,23 @@ "dbname/user@hostname") ("hostname" "dbname" "user")) -(deftest :db/1 - (let ((inner-db-same) - (original-a) - (outer-db-unchanged)) - (print "test-connection-spec") - (print *test-connection-spec*) - (clsql:with-database (a '*test-connection-spec* :database-type *test-connection-db-type*) - (setq original-a a) - (clsql:with-database (b '*test-connection-spec* :database-type *test-connection-db-type*) - (setq inner-db-same (eq a b))) - (setq outer-db-unchanged (eq a original-a)))) - t t) +(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) ))