-(defun test-basic-initialize ()
- (ignore-errors
- (clsql:execute-command "DROP TABLE TYPE_TABLE"))
- (clsql:execute-command
- "CREATE TABLE TYPE_TABLE (t_int integer, t_float double precision, t_bigint BIGINT, t_str VARCHAR(30))")
- (dotimes (i 11)
- (let* ((test-int (- i 5))
- (test-flt (transform-float-1 test-int)))
- (clsql:execute-command
- (format nil "INSERT INTO TYPE_TABLE VALUES (~a,~a,~a,'~a')"
- test-int
- (clsql-sys:number-to-sql-string test-flt)
- (transform-bigint-1 test-int)
- (clsql-sys:number-to-sql-string test-flt)
- )))))
-
-(defun test-basic-forms ()
- (append
- (test-basic-forms-untyped)
- '(
- (deftest :BASIC/TYPE/1
- (let ((results '()))
- (dolist (row (query "select * from TYPE_TABLE" :result-types :auto)
- results)
- (destructuring-bind (int float bigint str) row
- (push (list (integerp int)
- (typep float 'double-float)
- (if (and (eq :odbc *test-database-type*)
- (eq :postgresql *test-database-underlying-type*))
- ;; ODBC/Postgresql may return returns bigints as strings or integer
- ;; depending upon the platform
- t
- (integerp bigint))
- (stringp str))
- results))))
- ((t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t) (t t t t)))
-
- (deftest :BASIC/TYPE/2
- (let ((results '()))
- (dolist (row (query "select * from TYPE_TABLE" :result-types :auto)
- results)
- (destructuring-bind (int float bigint str) row
- (setq results
- (cons (list (double-float-equal
- (transform-float-1 int)
- float)
- (double-float-equal
- (parse-double str)
- float))
- results))))
- results)
+(setq *rt-basic*
+ '(
+ (deftest :basic/type/1
+ (let ((results '()))
+ (dolist (row (query "select * from TYPE_TABLE" :result-types :auto)
+ results)
+ (destructuring-bind (int float str) row
+ (push (list (integerp int)
+ (typep float 'double-float)
+ (stringp str))
+ results))))
+ ((t t t) (t t t) (t t t) (t t t) (t t t) (t t t) (t t t) (t t t) (t t t) (t t t) (t t t)))
+
+ (deftest :basic/type/2
+ (let ((results '()))
+ (dolist (row (query "select * from TYPE_TABLE" :result-types :auto)
+ results)
+ (destructuring-bind (int float str) row
+ (setq results
+ (cons (list (double-float-equal
+ (transform-float-1 int)
+ float)
+ (double-float-equal
+ (parse-double str)
+ float))
+ results))))
+ results)