on master help sign in
Clean up 80-column limits

--HG-- extra : convert_revision : 45fd4e1594954d69e22086cebe0ebb66dae066b7

commita85f57cab846708e198bfef6c986ce8c6ee696aa authorBryan O'Sullivan <bos@serpentine.com> dateSun 29 Aug 2010, 06:52 (16 years ago) parent6c7b834
1 file changed+107−57
tests/Properties.hs+107−57
tests/Properties.hs+107−57
@@ -144,8 +144,9 @@ eqP f g s w = eql "orig" (f s) (g t) &&
144144 m | l == 0 = n
145145 | otherwise = n `mod` l
146146 n = fromIntegral w
147− eql d a b | a =^= b = True
148− | otherwise = trace (d ++ ": " ++ show a ++ " /= " ++ show b) False
147+ eql d a b
148+ | a =^= b = True
149+ | otherwise = trace (d ++ ": " ++ show a ++ " /= " ++ show b) False
149150
150151-- For tests that have O(n^2) running times or input sizes, resize
151152-- their inputs to the square root of the originals.
@@ -187,15 +188,18 @@ s_snoc x = (++ [x]) `eqP` (unpackS . (flip S.snoc) x)
187188t_snoc x = (++ [x]) `eqP` (unpackS . (flip T.snoc) x)
188189tl_snoc x = (++ [x]) `eqP` (unpackS . (flip TL.snoc) x)
189190s_append s = (s++) `eqP` (unpackS . S.append (S.streamList s))
190−s_append_s s = (s++) `eqP` (unpackS . S.unstream . S.append (S.streamList s))
191−sf_append p s = (L.filter p s++) `eqP` (unpackS . S.append (S.filter p $ S.streamList s))
191+s_append_s s = (s++) `eqP`
192+ (unpackS . S.unstream . S.append (S.streamList s))
193+sf_append p s = (L.filter p s++) `eqP`
194+ (unpackS . S.append (S.filter p $ S.streamList s))
192195t_append s = (s++) `eqP` (unpackS . T.append (packS s))
193196
194197uncons (x:xs) = Just (x,xs)
195198uncons _ = Nothing
196199
197200s_uncons = uncons `eqP` (fmap (second unpackS) . S.uncons)
198−sf_uncons p = (uncons . L.filter p) `eqP` (fmap (second unpackS) . S.uncons . S.filter p)
201+sf_uncons p = (uncons . L.filter p) `eqP`
202+ (fmap (second unpackS) . S.uncons . S.filter p)
199203t_uncons = uncons `eqP` (fmap (second unpackS) . T.uncons)
200204tl_uncons = uncons `eqP` (fmap (second unpackS) . TL.uncons)
201205s_head = head `eqP` S.head
@@ -233,21 +237,31 @@ s_map_s f = map f `eqP` (unpackS . S.unstream . S.map f)
233237sf_map p f = (map f . L.filter p) `eqP` (unpackS . S.map f . S.filter p)
234238t_map f = map f `eqP` (unpackS . T.map f)
235239tl_map f = map f `eqP` (unpackS . TL.map f)
236−t_intercalate c = unsquare (L.intercalate c `eq` (unpackS . T.intercalate (packS c) . map packS))
237−tl_intercalate c = unsquare (L.intercalate c `eq` (unpackS . TL.intercalate (TL.pack c) . map TL.pack))
238−s_intersperse c = L.intersperse c `eqP` (unpackS . S.intersperse c)
239−s_intersperse_s c = L.intersperse c `eqP` (unpackS . S.unstream . S.intersperse c)
240−sf_intersperse p c= (L.intersperse c . L.filter p) `eqP` (unpackS . S.intersperse c . S.filter p)
240+t_intercalate c = unsquare $ L.intercalate c `eq`
241+ (unpackS . T.intercalate (packS c) . map packS)
242+tl_intercalate c = unsquare $
243+ L.intercalate c `eq`
244+ (unpackS . TL.intercalate (TL.pack c) . map TL.pack)
245+s_intersperse c = L.intersperse c `eqP`
246+ (unpackS . S.intersperse c)
247+s_intersperse_s c = L.intersperse c `eqP`
248+ (unpackS . S.unstream . S.intersperse c)
249+sf_intersperse p c= (L.intersperse c . L.filter p) `eqP`
250+ (unpackS . S.intersperse c . S.filter p)
241251t_intersperse c = L.intersperse c `eqP` (unpackS . T.intersperse c)
242252tl_intersperse c = L.intersperse c `eqP` (unpackS . TL.intersperse c)
243−t_transpose = unsquare (L.transpose `eq` (map unpackS . T.transpose . map packS))
244−tl_transpose = unsquare (L.transpose `eq` (map unpackS . TL.transpose . map TL.pack))
253+t_transpose = unsquare $ L.transpose `eq`
254+ (map unpackS . T.transpose . map packS)
255+tl_transpose = unsquare $ L.transpose `eq`
256+ (map unpackS . TL.transpose . map TL.pack)
245257t_reverse = L.reverse `eqP` (unpackS . T.reverse)
246258tl_reverse = L.reverse `eqP` (unpackS . TL.reverse)
247259t_reverse_short n = L.reverse `eqP` (unpackS . S.reverse . shorten n . S.stream)
248260
249−t_replace s d = (L.intercalate d . split s) `eqP` (unpackS . T.replace (T.pack s) (T.pack d))
250−tl_replace s d = (L.intercalate d . split s) `eqP` (unpackS . TL.replace (TL.pack s) (TL.pack d))
261+t_replace s d = (L.intercalate d . split s) `eqP`
262+ (unpackS . T.replace (T.pack s) (T.pack d))
263+tl_replace s d = (L.intercalate d . split s) `eqP`
264+ (unpackS . TL.replace (TL.pack s) (TL.pack d))
251265
252266split :: (Eq a) => [a] -> [a] -> [[a]]
253267split pat src0
@@ -292,31 +306,35 @@ center k c xs
292306
293307s_justifyLeft k c = justifyLeft j c `eqP` (unpackS . S.justifyLeftI j c)
294308 where j = fromIntegral (k :: Word8)
295−s_justifyLeft_s k c = justifyLeft j c `eqP` (unpackS . S.unstream . S.justifyLeftI j c)
309+s_justifyLeft_s k c = justifyLeft j c `eqP`
310+ (unpackS . S.unstream . S.justifyLeftI j c)
296311 where j = fromIntegral (k :: Word8)
297312sf_justifyLeft p k c = (justifyLeft j c . L.filter p) `eqP`
298313 (unpackS . S.justifyLeftI j c . S.filter p)
299314 where j = fromIntegral (k :: Word8)
300315t_justifyLeft k c = justifyLeft j c `eqP` (unpackS . T.justifyLeft j c)
301316 where j = fromIntegral (k :: Word8)
302−tl_justifyLeft k c = justifyLeft j c `eqP` (unpackS . TL.justifyLeft (fromIntegral j) c)
317+tl_justifyLeft k c = justifyLeft j c `eqP`
318+ (unpackS . TL.justifyLeft (fromIntegral j) c)
303319 where j = fromIntegral (k :: Word8)
304320t_justifyRight k c = justifyRight j c `eqP` (unpackS . T.justifyRight j c)
305321 where j = fromIntegral (k :: Word8)
306−tl_justifyRight k c = justifyRight j c `eqP` (unpackS . TL.justifyRight (fromIntegral j) c)
322+tl_justifyRight k c = justifyRight j c `eqP`
323+ (unpackS . TL.justifyRight (fromIntegral j) c)
307324 where j = fromIntegral (k :: Word8)
308325t_center k c = center j c `eqP` (unpackS . T.center j c)
309326 where j = fromIntegral (k :: Word8)
310327tl_center k c = center j c `eqP` (unpackS . TL.center (fromIntegral j) c)
311328 where j = fromIntegral (k :: Word8)
312329
313−sf_foldl p f z = (L.foldl f z . L.filter p) `eqP` (S.foldl f z . S.filter p)
330+sf_foldl p f z = (L.foldl f z . L.filter p) `eqP` (S.foldl f z . S.filter p)
314331 where _types = f :: Char -> Char -> Char
315332t_foldl f z = L.foldl f z `eqP` (T.foldl f z)
316333 where _types = f :: Char -> Char -> Char
317334tl_foldl f z = L.foldl f z `eqP` (TL.foldl f z)
318335 where _types = f :: Char -> Char -> Char
319−sf_foldl' p f z = (L.foldl' f z . L.filter p) `eqP` (S.foldl' f z . S.filter p)
336+sf_foldl' p f z = (L.foldl' f z . L.filter p) `eqP`
337+ (S.foldl' f z . S.filter p)
320338 where _types = f :: Char -> Char -> Char
321339t_foldl' f z = L.foldl' f z `eqP` T.foldl' f z
322340 where _types = f :: Char -> Char -> Char
@@ -338,13 +356,18 @@ sf_foldr1 p f = (L.foldr1 f . L.filter p) `eqP` (S.foldr1 f . S.filter p)
338356t_foldr1 f = L.foldr1 f `eqP` T.foldr1 f
339357tl_foldr1 f = L.foldr1 f `eqP` TL.foldr1 f
340358
341−s_concat_s = unsquare (L.concat `eq` (unpackS . S.unstream . S.concat . map packS))
342−sf_concat p = unsquare ((L.concat . map (L.filter p)) `eq` (unpackS . S.concat . map (S.filter p . packS)))
359+s_concat_s = unsquare $ L.concat `eq`
360+ (unpackS . S.unstream . S.concat . map packS)
361+sf_concat p = unsquare $ (L.concat . map (L.filter p)) `eq`
362+ (unpackS . S.concat . map (S.filter p . packS))
343363t_concat = unsquare (L.concat `eq` (unpackS . T.concat . map packS))
344364tl_concat = unsquare (L.concat `eq` (unpackS . TL.concat . map TL.pack))
345−sf_concatMap p f = unsquare ((L.concatMap f . L.filter p) `eqP` (unpackS . S.concatMap (packS . f) . S.filter p))
346−t_concatMap f = unsquare (L.concatMap f `eqP` (unpackS . T.concatMap (packS . f)))
347−tl_concatMap f = unsquare (L.concatMap f `eqP` (unpackS . TL.concatMap (TL.pack . f)))
365+sf_concatMap p f = unsquare $ (L.concatMap f . L.filter p) `eqP`
366+ (unpackS . S.concatMap (packS . f) . S.filter p)
367+t_concatMap f = unsquare $
368+ L.concatMap f `eqP` (unpackS . T.concatMap (packS . f))
369+tl_concatMap f = unsquare $
370+ L.concatMap f `eqP` (unpackS . TL.concatMap (TL.pack . f))
348371sf_any q p = (L.any p . L.filter q) `eqP` (S.any p . S.filter q)
349372t_any p = L.any p `eqP` T.any p
350373tl_any p = L.any p `eqP` TL.any p
@@ -358,7 +381,8 @@ sf_minimum p = (L.minimum . L.filter p) `eqP` (S.minimum . S.filter p)
358381t_minimum = L.minimum `eqP` T.minimum
359382tl_minimum = L.minimum `eqP` TL.minimum
360383
361−sf_scanl p f z = (L.scanl f z . L.filter p) `eqP` (unpackS . S.scanl f z . S.filter p)
384+sf_scanl p f z = (L.scanl f z . L.filter p) `eqP`
385+ (unpackS . S.scanl f z . S.filter p)
362386t_scanl f z = L.scanl f z `eqP` (unpackS . T.scanl f z)
363387tl_scanl f z = L.scanl f z `eqP` (unpackS . TL.scanl f z)
364388t_scanl1 f = L.scanl1 f `eqP` (unpackS . T.scanl1 f)
@@ -368,20 +392,25 @@ tl_scanr f z = L.scanr f z `eqP` (unpackS . TL.scanr f z)
368392t_scanr1 f = L.scanr1 f `eqP` (unpackS . T.scanr1 f)
369393tl_scanr1 f = L.scanr1 f `eqP` (unpackS . TL.scanr1 f)
370394
371−t_mapAccumL f z = unsquare (L.mapAccumL f z `eqP` (second unpackS . T.mapAccumL f z))
395+t_mapAccumL f z = unsquare $
396+ L.mapAccumL f z `eqP` (second unpackS . T.mapAccumL f z)
372397 where _types = f :: Int -> Char -> (Int,Char)
373−tl_mapAccumL f z = unsquare (L.mapAccumL f z `eqP` (second unpackS . TL.mapAccumL f z))
398+tl_mapAccumL f z = unsquare $
399+ L.mapAccumL f z `eqP` (second unpackS . TL.mapAccumL f z)
374400 where _types = f :: Int -> Char -> (Int,Char)
375−t_mapAccumR f z = unsquare (L.mapAccumR f z `eqP` (second unpackS . T.mapAccumR f z))
401+t_mapAccumR f z = unsquare $
402+ L.mapAccumR f z `eqP` (second unpackS . T.mapAccumR f z)
376403 where _types = f :: Int -> Char -> (Int,Char)
377−tl_mapAccumR f z = unsquare (L.mapAccumR f z `eqP` (second unpackS . TL.mapAccumR f z))
404+tl_mapAccumR f z = unsquare $
405+ L.mapAccumR f z `eqP` (second unpackS . TL.mapAccumR f z)
378406 where _types = f :: Int -> Char -> (Int,Char)
379407
380408replicate n l = concat (L.replicate n l)
381409
382410t_replicate n = replicate m `eq` (unpackS . T.replicate m . packS)
383411 where m = fromIntegral (n :: Word8)
384−tl_replicate n = replicate m `eq` (unpackS . TL.replicate (fromIntegral m) . packS)
412+tl_replicate n = replicate m `eq`
413+ (unpackS . TL.replicate (fromIntegral m) . packS)
385414 where m = fromIntegral (n :: Word8)
386415
387416unf :: Int -> Char -> Maybe (Char, Char)
@@ -407,33 +436,42 @@ unpack2 = unpackS *** unpackS
407436s_take n = L.take n `eqP` (unpackS . S.take n)
408437s_take_s m = L.take n `eqP` (unpackS . S.unstream . S.take n)
409438 where n = small m
410−sf_take p n = (L.take n . L.filter p) `eqP` (unpackS . S.take n . S.filter p)
439+sf_take p n = (L.take n . L.filter p) `eqP`
440+ (unpackS . S.take n . S.filter p)
411441t_take n = L.take n `eqP` (unpackS . T.take n)
412442tl_take n = L.take n `eqP` (unpackS . TL.take (fromIntegral n))
413443s_drop n = L.drop n `eqP` (unpackS . S.drop n)
414444s_drop_s m = L.drop n `eqP` (unpackS . S.unstream . S.drop n)
415445 where n = small m
416−sf_drop p n = (L.drop n . L.filter p) `eqP` (unpackS . S.drop n . S.filter p)
446+sf_drop p n = (L.drop n . L.filter p) `eqP`
447+ (unpackS . S.drop n . S.filter p)
417448t_drop n = L.drop n `eqP` (unpackS . T.drop n)
418449tl_drop n = L.drop n `eqP` (unpackS . TL.drop (fromIntegral n))
419450s_take_drop m = (L.take n . L.drop n) `eqP` (unpackS . S.take n . S.drop n)
420451 where n = small m
421−s_take_drop_s m = (L.take n . L.drop n) `eqP` (unpackS . S.unstream . S.take n . S.drop n)
452+s_take_drop_s m = (L.take n . L.drop n) `eqP`
453+ (unpackS . S.unstream . S.take n . S.drop n)
422454 where n = small m
423455s_takeWhile p = L.takeWhile p `eqP` (unpackS . S.takeWhile p)
424456s_takeWhile_s p = L.takeWhile p `eqP` (unpackS . S.unstream . S.takeWhile p)
425−sf_takeWhile q p = (L.takeWhile p . L.filter q) `eqP` (unpackS . S.takeWhile p . S.filter q)
457+sf_takeWhile q p = (L.takeWhile p . L.filter q) `eqP`
458+ (unpackS . S.takeWhile p . S.filter q)
426459t_takeWhile p = L.takeWhile p `eqP` (unpackS . T.takeWhile p)
427460tl_takeWhile p = L.takeWhile p `eqP` (unpackS . TL.takeWhile p)
428461s_dropWhile p = L.dropWhile p `eqP` (unpackS . S.dropWhile p)
429462s_dropWhile_s p = L.dropWhile p `eqP` (unpackS . S.unstream . S.dropWhile p)
430−sf_dropWhile q p = (L.dropWhile p . L.filter q) `eqP` (unpackS . S.dropWhile p . S.filter q)
463+sf_dropWhile q p = (L.dropWhile p . L.filter q) `eqP`
464+ (unpackS . S.dropWhile p . S.filter q)
431465t_dropWhile p = L.dropWhile p `eqP` (unpackS . T.dropWhile p)
432466tl_dropWhile p = L.dropWhile p `eqP` (unpackS . S.dropWhile p)
433−t_dropWhileEnd p = (L.reverse . L.dropWhile p . L.reverse) `eqP` (unpackS . T.dropWhileEnd p)
434−tl_dropWhileEnd p = (L.reverse . L.dropWhile p . L.reverse) `eqP` (unpackS . TL.dropWhileEnd p)
435−t_dropAround p = (L.dropWhile p . L.reverse . L.dropWhile p . L.reverse) `eqP` (unpackS . T.dropAround p)
436−tl_dropAround p = (L.dropWhile p . L.reverse . L.dropWhile p . L.reverse) `eqP` (unpackS . TL.dropAround p)
467+t_dropWhileEnd p = (L.reverse . L.dropWhile p . L.reverse) `eqP`
468+ (unpackS . T.dropWhileEnd p)
469+tl_dropWhileEnd p = (L.reverse . L.dropWhile p . L.reverse) `eqP`
470+ (unpackS . TL.dropWhileEnd p)
471+t_dropAround p = (L.dropWhile p . L.reverse . L.dropWhile p . L.reverse)
472+ `eqP` (unpackS . T.dropAround p)
473+tl_dropAround p = (L.dropWhile p . L.reverse . L.dropWhile p . L.reverse)
474+ `eqP` (unpackS . TL.dropAround p)
437475t_stripStart = T.dropWhile isSpace `eq` T.stripStart
438476tl_stripStart = TL.dropWhile isSpace `eq` TL.stripStart
439477t_stripEnd = T.dropWhileEnd isSpace `eq` T.stripEnd
@@ -492,7 +530,8 @@ t_split_i (NotEmpty t) = id `eq` (T.intercalate t . T.split t)
492530tl_split_i (NotEmpty t) = id `eq` (TL.intercalate t . TL.split t)
493531
494532t_splitBy p = splitBy p `eqP` (map unpackS . T.splitBy p)
495−t_splitBy_count c = (L.length . T.splitBy (==c)) `eq` ((1+) . T.count (T.singleton c))
533+t_splitBy_count c = (L.length . T.splitBy (==c)) `eq`
534+ ((1+) . T.count (T.singleton c))
496535t_splitBy_split c = T.splitBy (==c) `eq` T.split (T.singleton c)
497536tl_splitBy p = splitBy p `eqP` (map unpackS . TL.splitBy p)
498537
@@ -512,7 +551,8 @@ t_chunksOf_length k t = len == T.length t || (k <= 0 && len == 0)
512551
513552chunkify = TL.fromChunks . (:[])
514553
515−tl_chunksOf k = T.chunksOf k `eq` (map (T.concat . TL.toChunks) . TL.chunksOf (fromIntegral k) . chunkify)
554+tl_chunksOf k = T.chunksOf k `eq` (map (T.concat . TL.toChunks) .
555+ TL.chunksOf (fromIntegral k) . chunkify)
516556
517557t_lines = L.lines `eqP` (map unpackS . T.lines)
518558tl_lines = L.lines `eqP` (map unpackS . TL.lines)
@@ -534,8 +574,10 @@ tl_unlines = unsquare (L.unlines `eq` (unpackS . TL.unlines . map packS))
534574t_unwords = unsquare (L.unwords `eq` (unpackS . T.unwords . map packS))
535575tl_unwords = unsquare (L.unwords `eq` (unpackS . TL.unwords . map packS))
536576
537−s_isPrefixOf s = L.isPrefixOf s `eqP` (S.isPrefixOf (S.stream $ packS s) . S.stream)
538−sf_isPrefixOf p s = (L.isPrefixOf s . L.filter p) `eqP` (S.isPrefixOf (S.stream $ packS s) . S.filter p . S.stream)
577+s_isPrefixOf s = L.isPrefixOf s `eqP`
578+ (S.isPrefixOf (S.stream $ packS s) . S.stream)
579+sf_isPrefixOf p s = (L.isPrefixOf s . L.filter p) `eqP`
580+ (S.isPrefixOf (S.stream $ packS s) . S.filter p . S.stream)
539581t_isPrefixOf s = L.isPrefixOf s`eqP` T.isPrefixOf (packS s)
540582tl_isPrefixOf s = L.isPrefixOf s`eqP` TL.isPrefixOf (packS s)
541583t_isSuffixOf s = L.isSuffixOf s`eqP` T.isSuffixOf (packS s)
@@ -557,7 +599,8 @@ t_suffixed s = (fmap packS . suffixed s) `eqP` T.suffixed (packS s)
557599tl_suffixed s = (fmap packS . suffixed s) `eqP` TL.suffixed (packS s)
558600
559601sf_elem p c = (L.elem c . L.filter p) `eqP` (S.elem c . S.filter p)
560−sf_filter q p = (L.filter p . L.filter q) `eqP` (unpackS . S.filter p . S.filter q)
602+sf_filter q p = (L.filter p . L.filter q) `eqP`
603+ (unpackS . S.filter p . S.filter q)
561604t_filter p = L.filter p `eqP` (unpackS . T.filter p)
562605tl_filter p = L.filter p `eqP` (unpackS . TL.filter p)
563606sf_findBy q p = (L.find p . L.filter q) `eqP` (S.findBy p . S.filter q)
@@ -566,20 +609,24 @@ tl_findBy p = L.find p `eqP` TL.findBy p
566609t_partition p = L.partition p `eqP` (unpack2 . T.partitionBy p)
567610tl_partition p = L.partition p `eqP` (unpack2 . TL.partitionBy p)
568611
569−sf_index p s = forAll (choose (-l,l*2)) ((L.filter p s L.!!) `eq` S.index (S.filter p $ packS s))
612+sf_index p s = forAll (choose (-l,l*2))
613+ ((L.filter p s L.!!) `eq` S.index (S.filter p $ packS s))
570614 where l = L.length s
571615t_index s = forAll (choose (-l,l*2)) ((s L.!!) `eq` T.index (packS s))
572616 where l = L.length s
573617
574−tl_index s = forAll (choose (-l,l*2)) ((s L.!!) `eq` (TL.index (packS s) . fromIntegral))
618+tl_index s = forAll (choose (-l,l*2))
619+ ((s L.!!) `eq` (TL.index (packS s) . fromIntegral))
575620 where l = L.length s
576621
577622t_findIndex p = L.findIndex p `eqP` T.findIndex p
578623t_count (NotEmpty t) = (subtract 1 . L.length . T.split t) `eq` T.count t
579−tl_count (NotEmpty t) = (subtract 1 . L.genericLength . TL.split t) `eq` TL.count t
624+tl_count (NotEmpty t) = (subtract 1 . L.genericLength . TL.split t) `eq`
625+ TL.count t
580626t_zip s = L.zip s `eqP` T.zip (packS s)
581627tl_zip s = L.zip s `eqP` TL.zip (packS s)
582−sf_zipWith p c s = (L.zipWith c (L.filter p s) . L.filter p) `eqP` (unpackS . S.zipWith c (S.filter p $ packS s) . S.filter p)
628+sf_zipWith p c s = (L.zipWith c (L.filter p s) . L.filter p) `eqP`
629+ (unpackS . S.zipWith c (S.filter p $ packS s) . S.filter p)
583630t_zipWith c s = L.zipWith c s `eqP` (unpackS . T.zipWith c (packS s))
584631tl_zipWith c s = L.zipWith c s `eqP` (unpackS . TL.zipWith c (packS s))
585632
@@ -608,13 +655,16 @@ shiftR_Word32 = shiftR :: Word32 -> Property
608655
609656-- Builder.
610657
611−t_builderSingleton = id `eqP` (unpackS . TB.toLazyText . mconcat . map TB.singleton)
612−t_builderFromText = L.concat `eq` (unpackS . TB.toLazyText . mconcat . map (TB.fromText . packS))
613−t_builderAssociative s1 s2 s3 = TB.toLazyText (b1 `mappend` (b2 `mappend` b3)) ==
614− TB.toLazyText ((b1 `mappend` b2) `mappend` b3)
615− where b1 = TB.fromText (packS s1)
616− b2 = TB.fromText (packS s2)
617− b3 = TB.fromText (packS s3)
658+t_builderSingleton = id `eqP`
659+ (unpackS . TB.toLazyText . mconcat . map TB.singleton)
660+t_builderFromText = L.concat `eq` (unpackS . TB.toLazyText . mconcat .
661+ map (TB.fromText . packS))
662+t_builderAssociative s1 s2 s3 =
663+ TB.toLazyText (b1 `mappend` (b2 `mappend` b3)) ==
664+ TB.toLazyText ((b1 `mappend` b2) `mappend` b3)
665+ where b1 = TB.fromText (packS s1)
666+ b2 = TB.fromText (packS s2)
667+ b3 = TB.fromText (packS s3)
618668
619669-- Input and output.
620670
@@ -647,8 +697,8 @@ instance Arbitrary BufferMode where
647697 arbitrary = oneof [ return NoBuffering,
648698 return LineBuffering,
649699 return (BlockBuffering Nothing),
650− (BlockBuffering . Just . (+1) . fromIntegral) `fmap` arb16 ]
651− where arb16 = arbitrary :: Gen Word16
700+ (BlockBuffering . Just . (+1) . fromIntegral) `fmap`
701+ (arbitrary :: Gen Word16) ]
652702
653703-- This test harness is complex! What property are we checking?
654704--