r1675: *** empty log message ***
[clsql.git] / test-clsql.cl
index 0507e140ec472007e204a1c0b53fbc7b00b649d1..316c1ae995b4283437407670e361ff614ea1d6f2 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Mar 2002
 ;;;;
-;;;; $Id: test-clsql.cl,v 1.8 2002/03/25 23:48:46 kevin Exp $
+;;;; $Id: test-clsql.cl,v 1.10 2002/03/27 05:04:19 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
       (clsql-test-table spec type)))
   )
 
+(defun make-test-float (i)
+  (* i (expt 10 (* i 4))))
 
 (defun create-test-table (db)
   (ignore-errors
     (clsql:execute-command 
      "DROP TABLE test_clsql" :database db))
   (clsql:execute-command 
-   "CREATE TABLE test_clsql (i integer, sqrt float, sqrt_str CHAR(20))" :database db)
-  (dotimes (i 10)
-    (clsql:execute-command
-     (format nil "INSERT INTO test_clsql VALUES (~d,~d,'~a')"
-            i (sqrt i) (format nil "~d" (sqrt i)))
-     :database db)))
+   "CREATE TABLE test_clsql (n integer, flt float, flt_str CHAR(20))" 
+   :database db)
+  (dotimes (i 11)
+    (let ((n (- i 5)))
+      (clsql:execute-command
+       (format nil "INSERT INTO test_clsql VALUES (~a,~a,'~a')"
+              n (clsql:number-to-sql-string (make-test-float n))
+              (clsql:number-to-sql-string (make-test-float n)))
+       :database db))))
 
 (defun drop-test-table (db)
   (clsql:execute-command "DROP TABLE test_clsql"))
@@ -78,7 +83,7 @@
          (create-test-table db)
          (pprint (clsql:query "select * from test_clsql" 
                               :database db
-                              :types :auto))
+                              :types nil))
          (pprint (clsql:map-query 'vector #'list "select * from test_clsql" 
                                   :database db
                                   :types :auto)) ;;'(:int :double t)))