From d22f943ae95f7421218d74e68179b773c63c0635 Mon Sep 17 00:00:00 2001 From: Russ Tyndall Date: Tue, 26 Jan 2010 14:42:17 -0500 Subject: [PATCH] added a test for setting floats to nil and back (was failing in postgresql at some previously) --- tests/test-fdml.lisp | 2 -- tests/test-oodml.lisp | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/test-fdml.lisp b/tests/test-fdml.lisp index 9bacbe5..a467408 100644 --- a/tests/test-fdml.lisp +++ b/tests/test-fdml.lisp @@ -650,8 +650,6 @@ (("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* diff --git a/tests/test-oodml.lisp b/tests/test-oodml.lisp index 06e2460..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 -- 2.34.1