Remove CVS $Id$ keyword
[clsql.git] / tests / test-connection.lisp
index 6c3bc97d6d4316ae75386f13b8e41f51d1a87686..e15b682d8597bfe1f0654cc0de461fd4e180fc2c 100644 (file)
@@ -1,18 +1,18 @@
 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
-;;;; ======================================================================
-;;;; File:    test-connection.lisp
-;;;; Authors: Marcus Pearce <m.t.pearce@city.ac.uk>, 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)
 
      "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)
 
 ))