git.iko.soy/typeable/postgresql-simple
on master help sign in
Always set intervalstyle in tests
289acd2Oleg Grenrus
test/Interval.hs−3
@@ -54,9 +54,6 @@ testInterval env@TestEnv{..} = do
54
54
55 initializeTable env
55 initializeTable env
56
56
57− -- currently required for interval to work
58− execute_ conn "SET intervalstyle TO 'iso_8601'"
59−
60 let milliseconds = 0.001
57 let milliseconds = 0.001
61 seconds = 1
58 seconds = 1
62 minutes = 60 * seconds
59 minutes = 60 * seconds
test/Main.hs+5−1
@@ -606,7 +606,11 @@ isFormatError i FormatError{..}
606-- that 'testConnect' connects to the same database every time it is called.
606-- that 'testConnect' connects to the same database every time it is called.
607withTestEnv :: ByteString -> (TestEnv -> IO a) -> IO a
607withTestEnv :: ByteString -> (TestEnv -> IO a) -> IO a
608withTestEnv connstr cb =
608withTestEnv connstr cb =
609− withConn $ \conn ->
609+ withConn $ \conn -> do
610+ -- currently required for interval to work.
611+ -- we also test that this doesn't interfere with anything else
612+ execute_ conn "SET intervalstyle TO 'iso_8601'"
613+
610 cb TestEnv
614 cb TestEnv
611 { conn = conn
615 { conn = conn
612 , withConn = withConn
616 , withConn = withConn