From: Nathan Bird Date: Wed, 3 Feb 2010 15:48:33 +0000 (-0500) Subject: Adding a test that is just micro-seconds for sqlserver, marking usec ones as skip. X-Git-Tag: v5.0.0~23 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=26720328bdd7d8f28c3247063c477f05f3a7251e Adding a test that is just micro-seconds for sqlserver, marking usec ones as skip. --- diff --git a/tests/test-init.lisp b/tests/test-init.lisp index a7f8a84..8ce12ed 100644 --- a/tests/test-init.lisp +++ b/tests/test-init.lisp @@ -289,10 +289,14 @@ (push (cons test "Postgres specific test.") skip-tests)) ((and (member *test-database-underlying-type* '(:mysql)) + (clsql-sys:in test :time/cross-platform/msec + :time/cross-platform/usec/no-tz :time/cross-platform/usec/tz)) + (push (cons test "MySQL doesn't support fractional seconds on timestamp columns (http://forge.mysql.com/worklog/task.php?id=946).") + skip-tests)) + ((and (member *test-database-underlying-type* '(:mssql)) (clsql-sys:in test :time/cross-platform/usec/no-tz :time/cross-platform/usec/tz)) - (push (cons test "MySQL does not support fractional seconds on timestamp columns (http://forge.mysql.com/worklog/task.php?id=946).") + (push (cons test "MSSQL doesn't support micro-seconds on datetime columns.") skip-tests)) - (t (push test-form test-forms))))) (values (nreverse test-forms) (nreverse skip-tests)))) diff --git a/tests/test-time.lisp b/tests/test-time.lisp index 174ab75..39cc930 100644 --- a/tests/test-time.lisp +++ b/tests/test-time.lisp @@ -324,6 +324,22 @@ ))) #.(format-time nil (parse-timestring "2008-09-09T14:37:29-04:00") :format :iso)) +;;;This test gets at the databases that only support miliseconds, +;;; not microseconds. +(deftest :time/cross-platform/msec + (with-dataset *cross-platform-datetest* + (let ((time (parse-timestring "2008-09-09T14:37:29.423"))) + (clsql-sys:insert-records :into [datetest] + :attributes '([testtime]) + :values (list time)) + (let ((testtime + (first (clsql:select [testtime] + :from [datetest] :flatp T + :where [= [testtime] time] )))) + (format-time nil (parse-timestring testtime) :format :iso) + ))) + #.(format-time nil (parse-timestring "2008-09-09T14:37:29.423") :format :iso)) + (deftest :time/cross-platform/usec/no-tz (with-dataset *cross-platform-datetest* (let ((time (parse-timestring "2008-09-09T14:37:29.000213")))