Remove CVS $Id$ keyword
[clsql.git] / tests / test-fddl.lisp
index fde195db6d0e30990fb1bce8e26676f5e5b34742..ed25a04d2b9a65a396d5aa4b8064cd6b2b7086a0 100644 (file)
@@ -1,19 +1,19 @@
 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
-;;;; ======================================================================
-;;;; File:     test-fddl.lisp
-;;;; Authors:  Marcus Pearce <m.t.pearce@city.ac.uk> and Kevin Rosenberg
-;;;; Created:  30/03/2004
-;;;; Updated:  $Id$
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Tests for the CLSQL Functional Data Definition Language
-;;;; (FDDL).
+;;;; Name:     test-fddl.lisp
+;;;; Purpose:  Tests for the CLSQL Functional Data Definition Language
+;;;; 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)
 
            "3,'matey','1992-02-29',0.0")
   (:cleanup "DROP TABLE ALPHA" "DROP TABLE BRAVO"))
 
+(def-dataset *ds-fddl-parsing-oddities*
+  (:setup "CREATE TABLE ATEST (
+A varchar (32),
+B varchar(32))")
+  (:cleanup "DROP TABLE ATEST"))
+
 (setq *rt-fddl*
       '(
 
       (and (member (clsql:attribute-type [t_bigint] [TYPE_BIGINT]) '(:bigint :int8)) t))
   t)
 
+(deftest :fddl/attributes/8
+    ;;this is mostly from sqlite3 sending back
+    (with-dataset *ds-fddl-parsing-oddities*
+      (values
+       (clsql-sys:in (clsql:attribute-type [a] [atest]) :varchar :varchar2)
+       (clsql-sys:in (clsql:attribute-type [b] [atest]) :varchar :varchar2)))
+  t t)
+
 
 ;; create a view, test for existence, drop it and test again
 (deftest :fddl/view/1
             (let ((result
                    (list
                     ;; Shouldn't exist
-                    (clsql:select [a] [c] 
+                    (clsql:select [a] [c]
                                   :from [v1]
                                   :where [= [a] -1])
                     ;; Should exist
                                   (clsql:list-attributes [v1]))
                           #'string<)
                     ;; Shouldn't exist
-                    (clsql:select [x] [y] 
+                    (clsql:select [x] [y]
                                   :from [v1]
                                   :where [= [x] -1])
                     ;; Should exist
-                    (car (clsql:select [x] [y] 
+                    (car (clsql:select [x] [y]
                                        :from [v1]
                                        :where [= [x] 1])))))
 
               (clsql:index-exists-p [bar] )
               (clsql:index-exists-p [bar] :owner *test-database-user*)
               (clsql:index-exists-p [bar] :owner *test-false-database-user*)
-              
+
               (length (clsql-sys:list-indexes :on [alpha]))
               (length (clsql-sys:list-indexes :on [alpha] :owner *test-database-user*))
               (length (clsql-sys:list-indexes :on [alpha] :owner *test-false-database-user*))
            (clsql:sequence-exists-p [foo])
            (clsql:sequence-exists-p [foo] :owner *test-database-user*)
            (clsql:sequence-exists-p [foo] :owner *test-false-database-user*)
-           
+
            (progn
              (clsql:drop-sequence [foo] :if-does-not-exist :ignore)
              (clsql:sequence-exists-p [foo] ))))