X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=tests%2Ftest-connection.lisp;h=e15b682d8597bfe1f0654cc0de461fd4e180fc2c;hp=11d3cc43fe2ec92af5a3f9699028ed1a0cf3a62f;hb=d2d49ab13c98bc7a1819a0fd3968268a5567bdc3;hpb=9bbed78051e80e6ab76ae47834136035602bbbf1 diff --git a/tests/test-connection.lisp b/tests/test-connection.lisp index 11d3cc4..e15b682 100644 --- a/tests/test-connection.lisp +++ b/tests/test-connection.lisp @@ -1,39 +1,58 @@ ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ====================================================================== -;;;; File: test-connection.lisp -;;;; Authors: Marcus Pearce , Kevin Rosenberg -;;;; Created: 30/03/2004 -;;;; Updated: $Id$ +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION ;;;; -;;;; Tests for CLSQL database connections. +;;;; Name: test-connection.lisp +;;;; Purpose: Tests for CLSQL database connections +;;;; Authors: Marcus Pearce and Kevin M. Rosenberg +;;;; Created: March 2004 ;;;; ;;;; This file is part of CLSQL. ;;;; ;;;; CLSQL users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ====================================================================== +;;;; ************************************************************************* (in-package #:clsql-tests) (setq *rt-connection* '( - + (deftest :connection/1 (let ((database (clsql:find-database (clsql:database-name clsql:*default-database*) - :db-type (clsql:database-type clsql:*default-database*)))) - (eql (clsql:database-type database) *test-database-type*)) + :db-type (clsql-sys:database-type clsql:*default-database*)))) + (eql (clsql-sys:database-type database) *test-database-type*)) t) (deftest :connection/2 - (clsql-base::string-to-list-connection-spec + (clsql-sys::string-to-list-connection-spec "localhost/dbname/user/passwd") ("localhost" "dbname" "user" "passwd")) (deftest :connection/3 - (clsql-base::string-to-list-connection-spec + (clsql-sys::string-to-list-connection-spec "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) + ))