git.iko.soy/typeable/postgresql-simple
on master help sign in
Always set intervalstyle in tests
commit289acd2f8a7bb813ad408db0b05e99e647228c90 authorOleg Grenrus <oleg.grenrus@iki.fi> dateWed 6 Jan 2021, 18:20 (6 years ago) parent0d8e76e
2 files changed+5−4
test/Interval.hs−3 test/Main.hs+5−1
test/Interval.hs−3
@@ -54,9 +54,6 @@ testInterval env@TestEnv{..} = do
5454
5555 initializeTable env
5656
57− -- currently required for interval to work
58− execute_ conn "SET intervalstyle TO 'iso_8601'"
59−
6057 let milliseconds = 0.001
6158 seconds = 1
6259 minutes = 60 * seconds
test/Main.hs+5−1
@@ -606,7 +606,11 @@ isFormatError i FormatError{..}
606606-- that 'testConnect' connects to the same database every time it is called.
607607withTestEnv :: ByteString -> (TestEnv -> IO a) -> IO a
608608withTestEnv 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+
610614 cb TestEnv
611615 { conn = conn
612616 , withConn = withConn