git.iko.soy/typeable/postgresql-simple
on master help sign in
Improve test case for COPY OUT
commit6182abc3308ff9629bb80c45d957cd632ea98ff7 authorLeon P Smith <leon@melding-monads.com> dateThu 4 Sep 2014, 15:27 (12 years ago) parent1dc80bf
1 file changed+6−2
test/Main.hs+6−2
test/Main.hs+6−2
@@ -287,11 +287,15 @@ testCopy TestEnv{..} = TestCase $ do
287287 copy_ conn "COPY copy_test FROM STDIN (FORMAT CSV)"
288288 mapM_ (putCopyData conn) abortRows
289289 putCopyError conn "aborted"
290− copy_ conn "COPY copy_test TO STDOUT (FORMAT CSV)"
291− rows <- loop []
292290 -- Hmm, does postgres always produce \n as an end-of-line here, or
293291 -- are there cases where it will use a \r\n as well?
292+ copy_ conn "COPY copy_test TO STDOUT (FORMAT CSV)"
293+ rows <- loop []
294294 sort rows @?= sort copyRows
295+ -- Now, let's just verify that the connection state is back to ready,
296+ -- so that we can issue more queries:
297+ [Only (x::Int)] <- query_ conn "SELECT 2 + 2"
298+ x @?= 4
295299 where
296300 copyRows = ["1,foo\n"
297301 ,"2,bar\n"]