diff options
author | michaelt <what_is_it_to_do_anything@yahoo.com> | 2013-12-26 14:49:51 -0500 |
---|---|---|
committer | michaelt <what_is_it_to_do_anything@yahoo.com> | 2013-12-26 14:49:51 -0500 |
commit | cd4fd5dd5405ad8e324f43ee2bc81822bdece16c (patch) | |
tree | 6818ac464e211e30b55831fad8f750fedcac75ab /test | |
parent | 1b4f53266cadfbd54f8198908424b4890fb1755f (diff) | |
download | text-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.hs | 5 |
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 | |||
23 | import qualified Pipes.Text as TP | 23 | import qualified Pipes.Text as TP |
24 | import qualified Pipes.ByteString as BP | 24 | import qualified Pipes.ByteString as BP |
25 | import qualified Pipes as P | 25 | import qualified Pipes as P |
26 | import Debug.Trace | ||
27 | 26 | ||
28 | main :: IO () | 27 | main :: IO () |
29 | main = defaultMain [tests] | 28 | main = defaultMain [tests] |
@@ -31,7 +30,7 @@ main = defaultMain [tests] | |||
31 | 30 | ||
32 | tests = testGroup "stream_decode" [ | 31 | tests = 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 | ||
37 | t_utf8_incr_valid = do | 36 | t_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` |