added a test for setting floats to nil and back (was failing in postgresql at some...
authorRuss Tyndall <russ@acceleration.net>
Tue, 26 Jan 2010 19:42:17 +0000 (14:42 -0500)
committerNathan Bird <nathan@acceleration.net>
Mon, 1 Feb 2010 19:49:34 +0000 (14:49 -0500)
tests/test-fdml.lisp
tests/test-oodml.lisp

index 9bacbe52024dc7abf5e35e57fbe08ed28d06e4f6..a46740808dd15b54e68c3712e9e4250fe10d0f24 100644 (file)
   (("Yuri" "Gagarin" "gagarin@soviet.org"))
   (("Vladimir" "Lenin" "lenin@soviet.org")))
 
-
-
 ;; starts a transaction deletes a record and then rolls back the deletion
 (deftest :fdml/transaction/1
     (with-dataset *ds-employees*
index 06e246005487bb8bc1526988d774b7fb49f9b4b1..6ab648a03ac1c30ff2a3adc0ca57af96519295fb 100644 (file)
   "10 Altered subloc title Altered loc"
   "10 subloc-1 a subloc")
 
+;; Verify that we can set a float to nil and then read it back
+;; (was failing in Postgresql at somepoint)
+(deftest :oodml/update-records/10
+    (with-dataset *ds-employees*
+      (let ((emp (first (clsql:select 'employee :where [= [emplid] 1] :flatp T))))
+       (setf (height emp) nil)
+       (clsql-sys:update-record-from-slot emp 'height)
+       (values
+         (clsql:select [height] :from [employee] :where [= [emplid] 1])
+         (progn
+           (setf (height emp) 42.0)
+           (clsql-sys:update-record-from-slot emp 'height)
+           (clsql:select [height] :from [employee] :where [= [emplid] 1]))
+         (progn
+           (setf (height emp) 24.13d0)
+           (clsql-sys:update-record-from-slot emp 'height)
+           (clsql:select [height] :from [employee] :where [= [emplid] 1])))))
+  ((nil))
+  ((42.0d0))
+  ((24.13d0)))
+
 
 ;; tests update-instance-from-records
 (deftest :oodml/update-instance/1