uncouple cl-postgres and simple-date tests
[postmodern.git] / cl-postgres / simple-date-tests.lisp
blob77db3369fd971563d9a7892b2727b52249b34815
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
8 (with-test-connection
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)"
11 'list-row-reader))
12 (encode-timestamp 2010 4 5 14 42 21 500))))))
14 (test row-timestamp-with-time-zone-binary
15 (with-test-connection
16 (with-binary-row-values
17 (is (time= (caaar (exec-query connection "select row('2010-04-05 14:42:21.500'::timestamp with time zone)"
18 'list-row-reader))
19 (encode-timestamp 2010 4 5 14 42 21 500))))))
21 (test row-timestamp-without-time-zone-array-binary
22 (with-test-connection
23 (with-binary-row-values
24 (is (time= (elt (caaar (exec-query connection "select row(ARRAY['2010-04-05 14:42:21.500'::timestamp without time zone])"
25 'list-row-reader)) 0)
26 (encode-timestamp 2010 4 5 14 42 21 500))))))
28 (test row-time-binary
29 (with-test-connection
30 (with-binary-row-values
31 (is (time= (caaar (exec-query connection "select row('05:00'::time)"
32 'list-row-reader))
33 (encode-time-of-day 5 0))))))
35 (test row-timestamp-binary
36 (with-test-connection
37 (with-binary-row-values
38 (is (time= (caaar (exec-query connection "select row('2010-04-05 14:42:21.500'::timestamp)"
39 'list-row-reader))
40 (encode-timestamp 2010 4 5 14 42 21 500))))))