X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=test-clsql.cl;h=2f1d960caef5e4347e2ffdd9a3299bb6ebc51b12;hp=7d46988fad8179a34dcf558d0f13a0a78d76e8c2;hb=9a78eef71c902d3b272fb7c777bff6dd0acd8a2b;hpb=b06cb6d32e2a334f7dc72e8fb583a5b9609136b7 diff --git a/test-clsql.cl b/test-clsql.cl index 7d46988..2f1d960 100644 --- a/test-clsql.cl +++ b/test-clsql.cl @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: test-clsql.cl,v 1.1 2002/03/23 14:04:49 kevin Exp $ +;;;; $Id: test-clsql.cl,v 1.2 2002/03/24 04:01:26 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -19,6 +19,7 @@ (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) (in-package :cl-user) + (defun get-spec-and-type () (format t "~&Test CLSQL") (format t "~&==========~%") @@ -28,16 +29,16 @@ (let ((type-string (read-line))) (if (zerop (length type-string)) (values nil nil) - (let* ((type (read-from-string type-string)) - (spec (get-spec type - (ecase type - ((:mysql :postgresql :postgresql-socket) - '("host" "database" "user" "password")) - (:aodbc - '("dsn" "user" "password")))))) - (when (eq type :mysql) - (test-clsql-mysql spec)) - (values spec type))))) + (get-spec-for-type (read-from-string type-string))))) + +(defun get-spec-for-type (type) + (let ((spec (get-spec type + (ecase type + ((:mysql :postgresql :postgresql-socket) + '("host" "database" "user" "password")) + (:aodbc + '("dsn" "user" "password")))))) + (values spec type))))) (defun get-spec (type spec-format) @@ -51,6 +52,8 @@ (nreverse spec))) (defun test-clsql (spec type) + (when (eq type :mysql) + (test-clsql-mysql spec)) (let ((db (clsql:connect spec :database-type type :if-exists :new))) (unwind-protect (progn @@ -85,7 +88,7 @@ (clsql-mysql::database-execute-command "DROP TABLE test_clsql" db) (clsql-mysql::database-disconnect db))) - +#-non-interactive-test (do ((done nil)) (done) (multiple-value-bind (spec type) (get-spec-and-type)