X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftest-oodml.lisp;h=6ab648a03ac1c30ff2a3adc0ca57af96519295fb;hb=d22f943ae95f7421218d74e68179b773c63c0635;hp=ca1b7f81077780126ecd49865de21f436c73dff3;hpb=4b707b868821809b3a057c5e0f10c4e750e8b297;p=clsql.git diff --git a/tests/test-oodml.lisp b/tests/test-oodml.lisp index ca1b7f8..6ab648a 100644 --- a/tests/test-oodml.lisp +++ b/tests/test-oodml.lisp @@ -594,6 +594,27 @@ "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 @@ -630,7 +651,7 @@ (slot-value employee1 'email)))) "lenin@soviet.org" "lenin-nospam@soviet.org") -;; tests normalisedp update-instance-from-records +;; tests normalizedp update-instance-from-records (deftest :oodml/update-instance/3 (with-dataset *ds-nodes* (values @@ -697,7 +718,7 @@ "11 subloc-2 second subloc" "11 Altered title Altered loc") -;; tests update-slot-from-record with normalisedp stuff +;; tests update-slot-from-record with normalizedp stuff (deftest :oodml/update-instance/6 (with-dataset *ds-nodes* (values