]> code.delx.au - offlineimap/commitdiff
Added writeBytes test
authorJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 15:34:34 +0000 (10:34 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 15:34:34 +0000 (10:34 -0500)
testsrc/TestConnection.hs

index 97c7f03e4d1d914e9cc64b40ae35ede62deaaf4b..79e70979c2c4c6ae399d69eb5b810892324f7740 100644 (file)
@@ -66,9 +66,15 @@ prop_readBytes s l =
                     LT -> Right (take l s, (drop l s, []))
                     GT -> Left "EOF in input in readBytes"
 
+prop_writeBytes :: [String] -> Result
+prop_writeBytes s =
+    runStringConnection [] (\c -> mapM_ (writeBytes c) s) @?=
+                        Right ((), ([], concat s))
+
 allt = [q "Identity" prop_identity,
         q "Lines identity" prop_linesidentity,
         q "Lines list identity" prop_lineslistidentity,
         q "readline" prop_readLine,
-        q "readBytes" prop_readBytes
+        q "readBytes" prop_readBytes,
+        q "writeBytes" prop_writeBytes
        ]