r9119: Automated commit for Debian build of clsql upstream-version-2.9.2
[clsql.git] / tests / test-fdml.lisp
index ef364ba40b8eb80c4414792409133491e394660b..81fea97ea306c2dddf4ae77d8d28e5bce6ad4bdf 100644 (file)
@@ -4,14 +4,15 @@
 ;;;; Author:  Marcus Pearce <m.t.pearce@city.ac.uk>
 ;;;; Created: 30/03/2004
 ;;;; Updated: $Id$
-;;;; ======================================================================
-;;;;
-;;;; Description ==========================================================
-;;;; ======================================================================
 ;;;;
 ;;;; Tests for the CLSQL Functional Data Manipulation Language
 ;;;; (FDML).
-;;;; 
+;;;;
+;;;; 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)
 (deftest :fdml/select/10
     (clsql:select [last-name] :from [employee]
                 :where [not [in [emplid]
-                                [select [managerid] :from  [company]]]]
+                                [select [managerid] :from [company]]]]
                 :flatp t
                 :order-by [last-name])
   ("Andropov" "Brezhnev" "Chernenko" "Gorbachev" "Kruschev" "Putin" "Stalin"
       ;; test if we are in a transaction
       (push (clsql:in-transaction-p) results)
       ;;Putin has got to go
-      (unless (eql *test-database-type* :mysql)
-        (clsql:delete-records :from [employee] :where [= [last-name] "Putin"]))
+      (clsql:delete-records :from [employee] :where [= [last-name] "Putin"])
       ;;Should be nil 
       (push 
        (clsql:select [*] :from [employee] :where [= [last-name] "Putin"])
       ;; test if we are in a transaction
       (push (clsql:in-transaction-p) results)
       ;;Putin has got to go
-      (unless (eql *test-database-type* :mysql)
-        (clsql:update-records [employee]
-                             :av-pairs '((email "putin-nospam@soviet.org"))
-                             :where [= [last-name] "Putin"]))
+      (clsql:update-records [employee]
+       :av-pairs '((email "putin-nospam@soviet.org"))
+       :where [= [last-name] "Putin"])
       ;;Should be new value  
       (push (clsql:select [email] :from [employee]
                          :where [= [last-name] "Putin"]
     (let ((results '()))
       ;; check status
       (push (clsql:in-transaction-p) results)
-      (unless (eql *test-database-type* :mysql)
-        (handler-case 
-            (clsql:with-transaction () 
-              ;; valid update
-              (clsql:update-records [employee] 
-                                   :av-pairs '((email "lenin-nospam@soviet.org"))
-                                 :where [= [emplid] 1])
-            ;; invalid update which generates an error 
+      (handler-case 
+         (clsql:with-transaction () 
+           ;; valid update
+           (clsql:update-records [employee] 
+                                 :av-pairs '((email "lenin-nospam@soviet.org"))
+                                 :where [= [emplid] 1])
+           ;; invalid update which generates an error 
             (clsql:update-records [employee] 
-                                 :av-pairs
-                                 '((emale "lenin-nospam@soviet.org"))
-                                 :where [= [emplid] 1]))
-        (clsql:clsql-sql-error ()
+                                 :av-pairs
+                                 '((emale "lenin-nospam@soviet.org"))
+                                 :where [= [emplid] 1]))
+        (clsql:clsql-error ()
           (progn
             ;; check status 
             (push (clsql:in-transaction-p) results)
             (push (clsql:select [email] :from [employee] :where [= [emplid] 1]
                                :flatp t)
                   results)
-            (apply #'values (nreverse results)))))))
+            (apply #'values (nreverse results))))))
   nil nil ("lenin@soviet.org"))
 
 ))