X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=tests%2Ftest-time.lisp;h=174ab75041811060e9d6861e1394980d931109e2;hp=5d2e2e580992bc2cc3a24a912ce751532ee842e0;hb=094055ce16c61b63ff5f92814d4d1b4ecec2a9ee;hpb=24fade3a91cc98a4a08509de1893f21ec37f8ebe diff --git a/tests/test-time.lisp b/tests/test-time.lisp index 5d2e2e5..174ab75 100644 --- a/tests/test-time.lisp +++ b/tests/test-time.lisp @@ -69,6 +69,25 @@ (decode-time time1)) 3 32 56 14 23 1 2010 6) +(deftest :time/print-parse/1 + ;;make sure when we print and parse we get the same time. + (let* ((time (clsql-sys:make-time :year 2010 :month 1 :day 4 + :hour 14 :minute 15 :second 44)) + (string-time (iso-timestring time)) + (time2 (parse-timestring string-time))) + (decode-time time2)) + 0 44 15 14 4 1 2010 1) + +(deftest :time/print-parse/2 + ;;make sure when we print and parse we get the same time. + (let* ((time (clsql-sys:make-time :year 2010 :month 1 :day 4 + :hour 14 :minute 15 :second 44 :usec 3)) + (string-time (iso-timestring time)) + (time2 (parse-timestring string-time))) + (decode-time time2)) + 3 44 15 14 4 1 2010 1) + + ;; relations of intervals (deftest :time/1 (let* ((time-1 (clsql:parse-timestring "2002-01-01 10:00:00")) @@ -273,17 +292,6 @@ t) -(deftest :time/14-usec - ;;make sure when we print and parse we get the same time. - (let* ((time (clsql-sys:make-time :year 2010 :month 1 :day 4 - :hour 14 :minute 15 :second 44 :usec 3)) - (string-time (clsql-sys:format-time nil time :format :iso)) - (time2 (clsql-sys:parse-timestring string-time))) - (format-time nil time2 :format :iso)) - #.(format-time nil (clsql-sys:make-time :year 2010 :month 1 :day 4 - :hour 14 :minute 15 :second 44 :usec 3) - :format :iso)) - ;;; The cross platform dataset uses the 'timestamp' column type which is ;;; in sql-92, for all that means.