aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authormichaelt <what_is_it_to_do_anything@yahoo.com>2013-12-26 14:49:51 -0500
committermichaelt <what_is_it_to_do_anything@yahoo.com>2013-12-26 14:49:51 -0500
commitcd4fd5dd5405ad8e324f43ee2bc81822bdece16c (patch)
tree6818ac464e211e30b55831fad8f750fedcac75ab /test
parent1b4f53266cadfbd54f8198908424b4890fb1755f (diff)
downloadtext-pipes-cd4fd5dd5405ad8e324f43ee2bc81822bdece16c.tar.gz
text-pipes-cd4fd5dd5405ad8e324f43ee2bc81822bdece16c.tar.zst
text-pipes-cd4fd5dd5405ad8e324f43ee2bc81822bdece16c.zip
repaired tests, clean encodeUtf8 to return Done r rather than yield B.empty >> Done r when decoding was perfect
Diffstat (limited to 'test')
-rw-r--r--test/Test.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/Test.hs b/test/Test.hs
index 53dca6a..f2bf17b 100644
--- a/test/Test.hs
+++ b/test/Test.hs
@@ -23,7 +23,6 @@ import qualified Pipes.Text.Internal as PE
23import qualified Pipes.Text as TP 23import qualified Pipes.Text as TP
24import qualified Pipes.ByteString as BP 24import qualified Pipes.ByteString as BP
25import qualified Pipes as P 25import qualified Pipes as P
26import Debug.Trace
27 26
28main :: IO () 27main :: IO ()
29main = defaultMain [tests] 28main = defaultMain [tests]
@@ -31,7 +30,7 @@ main = defaultMain [tests]
31 30
32tests = testGroup "stream_decode" [ 31tests = testGroup "stream_decode" [
33 -- testProperty "t_utf8_incr_valid" t_utf8_incr_valid, 32 -- testProperty "t_utf8_incr_valid" t_utf8_incr_valid,
34-- testProperty "t_utf8_incr_mixed" t_utf8_incr_mixed ] -- , 33 testProperty "t_utf8_incr_mixed" t_utf8_incr_mixed ,
35 testProperty "t_utf8_incr_pipe" t_utf8_incr_pipe] 34 testProperty "t_utf8_incr_pipe" t_utf8_incr_pipe]
36 35
37t_utf8_incr_valid = do 36t_utf8_incr_valid = do
@@ -72,7 +71,7 @@ t_utf8_incr_pipe = do
72 Positive n <- arbitrary 71 Positive n <- arbitrary
73 txt <- genUnicode 72 txt <- genUnicode
74 let chunkSize = mod n 7 + 1 73 let chunkSize = mod n 7 + 1
75 bytesLength = mod 3 m 74 bytesLength = mod 10 m
76 forAll (vector bytesLength) $ 75 forAll (vector bytesLength) $
77 (BL.toStrict . BP.toLazy . roundtrip . P.each . chunk chunkSize . appendBytes txt) 76 (BL.toStrict . BP.toLazy . roundtrip . P.each . chunk chunkSize . appendBytes txt)
78 `eq` 77 `eq`