2 (in-package :cl-postgres-tests
)
4 (def-suite :cl-postgres-simple-date
)
5 (in-suite :cl-postgres-simple-date
)
7 (test row-timestamp-without-time-zone-binary
9 (with-binary-row-values
10 (is (time= (caaar (exec-query connection
"select row('2010-04-05 14:42:21.500'::timestamp without time zone)"
12 (encode-timestamp 2010 4 5 14 42 21 500))))))
14 (test row-timestamp-with-time-zone-binary
16 (with-binary-row-values
17 (destructuring-bind (gmt pdt
)
22 "select row('2010-04-05 14:42:21.500'::timestamp with time zone at time zone 'GMT', "
23 " '2010-04-05 14:42:21.500'::timestamp with time zone at time zone 'PST')")
25 (is (time= gmt
(encode-timestamp 2010 4 5 14 42 21 500)))
26 (is (time= pdt
(encode-timestamp 2010 4 5 6 42 21 500)))))))
28 (test row-timestamp-without-time-zone-array-binary
30 (with-binary-row-values
31 (is (time= (elt (caaar (exec-query connection
"select row(ARRAY['2010-04-05 14:42:21.500'::timestamp without time zone])"
33 (encode-timestamp 2010 4 5 14 42 21 500))))))
37 (with-binary-row-values
38 (is (time= (caaar (exec-query connection
"select row('05:00'::time)"
40 (encode-time-of-day 5 0))))))
42 (test row-timestamp-binary
44 (with-binary-row-values
45 (is (time= (caaar (exec-query connection
"select row('2010-04-05 14:42:21.500'::timestamp)"
47 (encode-timestamp 2010 4 5 14 42 21 500))))))