on master help sign in
Slow tests down - we were shrinking too aggressively

--HG-- extra : convert_revision : 1971caa920d0f04ed544d146450737ff069a9ea7

commit5e1d5c9f8ca3af0589454780f3000b0fe7688aad authorBryan O'Sullivan <bos@serpentine.com> dateSun 29 Aug 2010, 18:24 (16 years ago) parent0eb5042
1 file changed+35−46
tests/Properties.hs+35−46
tests/Properties.hs+35−46
@@ -181,8 +181,8 @@ t_Show = show `eq` (show . T.pack)
181181tl_Show = show `eq` (show . TL.pack)
182182t_mappend s = mappend s`eqP` (unpackS . mappend (T.pack s))
183183tl_mappend s = mappend s`eqP` (unpackS . mappend (TL.pack s))
184−t_mconcat = unsquare (mconcat `eq` (unpackS . mconcat . L.map T.pack))
185−tl_mconcat = unsquare (mconcat `eq` (unpackS . mconcat . L.map TL.pack))
184+t_mconcat = mconcat `eq` (unpackS . mconcat . L.map T.pack)
185+tl_mconcat = mconcat `eq` (unpackS . mconcat . L.map TL.pack)
186186t_IsString = fromString `eqP` (T.unpack . fromString)
187187tl_IsString = fromString `eqP` (TL.unpack . fromString)
188188
@@ -244,10 +244,9 @@ s_map_s f = map f `eqP` (unpackS . S.unstream . S.map f)
244244sf_map p f = (map f . L.filter p) `eqP` (unpackS . S.map f . S.filter p)
245245t_map f = map f `eqP` (unpackS . T.map f)
246246tl_map f = map f `eqP` (unpackS . TL.map f)
247−t_intercalate c = unsquare $ L.intercalate c `eq`
248− (unpackS . T.intercalate (packS c) . map packS)
249−tl_intercalate c = unsquare $
250− L.intercalate c `eq`
247+t_intercalate c = L.intercalate c `eq`
248+ (unpackS . T.intercalate (packS c) . map packS)
249+tl_intercalate c = L.intercalate c `eq`
251250 (unpackS . TL.intercalate (TL.pack c) . map TL.pack)
252251s_intersperse c = L.intersperse c `eqP`
253252 (unpackS . S.intersperse c)
@@ -257,10 +256,8 @@ sf_intersperse p c= (L.intersperse c . L.filter p) `eqP`
257256 (unpackS . S.intersperse c . S.filter p)
258257t_intersperse c = L.intersperse c `eqP` (unpackS . T.intersperse c)
259258tl_intersperse c = L.intersperse c `eqP` (unpackS . TL.intersperse c)
260−t_transpose = unsquare $ L.transpose `eq`
261− (map unpackS . T.transpose . map packS)
262−tl_transpose = unsquare $ L.transpose `eq`
263− (map unpackS . TL.transpose . map TL.pack)
259+t_transpose = L.transpose `eq` (map unpackS . T.transpose . map packS)
260+tl_transpose = L.transpose `eq` (map unpackS . TL.transpose . map TL.pack)
264261t_reverse = L.reverse `eqP` (unpackS . T.reverse)
265262tl_reverse = L.reverse `eqP` (unpackS . TL.reverse)
266263t_reverse_short n = L.reverse `eqP` (unpackS . S.reverse . shorten n . S.stream)
@@ -363,12 +360,11 @@ sf_foldr1 p f = (L.foldr1 f . L.filter p) `eqP` (S.foldr1 f . S.filter p)
363360t_foldr1 f = L.foldr1 f `eqP` T.foldr1 f
364361tl_foldr1 f = L.foldr1 f `eqP` TL.foldr1 f
365362
366−s_concat_s = unsquare $ L.concat `eq`
367− (unpackS . S.unstream . S.concat . map packS)
368−sf_concat p = unsquare $ (L.concat . map (L.filter p)) `eq`
369− (unpackS . S.concat . map (S.filter p . packS))
370−t_concat = unsquare (L.concat `eq` (unpackS . T.concat . map packS))
371−tl_concat = unsquare (L.concat `eq` (unpackS . TL.concat . map TL.pack))
363+s_concat_s = L.concat `eq` (unpackS . S.unstream . S.concat . map packS)
364+sf_concat p = (L.concat . map (L.filter p)) `eq`
365+ (unpackS . S.concat . map (S.filter p . packS))
366+t_concat = L.concat `eq` (unpackS . T.concat . map packS)
367+tl_concat = L.concat `eq` (unpackS . TL.concat . map TL.pack)
372368sf_concatMap p f = unsquare $ (L.concatMap f . L.filter p) `eqP`
373369 (unpackS . S.concatMap (packS . f) . S.filter p)
374370t_concatMap f = unsquare $
@@ -399,18 +395,14 @@ tl_scanr f z = L.scanr f z `eqP` (unpackS . TL.scanr f z)
399395t_scanr1 f = L.scanr1 f `eqP` (unpackS . T.scanr1 f)
400396tl_scanr1 f = L.scanr1 f `eqP` (unpackS . TL.scanr1 f)
401397
402−t_mapAccumL f z = unsquare $
403− L.mapAccumL f z `eqP` (second unpackS . T.mapAccumL f z)
404− where _types = f :: Int -> Char -> (Int,Char)
405−tl_mapAccumL f z = unsquare $
406− L.mapAccumL f z `eqP` (second unpackS . TL.mapAccumL f z)
407− where _types = f :: Int -> Char -> (Int,Char)
408−t_mapAccumR f z = unsquare $
409− L.mapAccumR f z `eqP` (second unpackS . T.mapAccumR f z)
410− where _types = f :: Int -> Char -> (Int,Char)
411−tl_mapAccumR f z = unsquare $
412− L.mapAccumR f z `eqP` (second unpackS . TL.mapAccumR f z)
413− where _types = f :: Int -> Char -> (Int,Char)
398+t_mapAccumL f z = L.mapAccumL f z `eqP` (second unpackS . T.mapAccumL f z)
399+ where _types = f :: Int -> Char -> (Int,Char)
400+tl_mapAccumL f z = L.mapAccumL f z `eqP` (second unpackS . TL.mapAccumL f z)
401+ where _types = f :: Int -> Char -> (Int,Char)
402+t_mapAccumR f z = L.mapAccumR f z `eqP` (second unpackS . T.mapAccumR f z)
403+ where _types = f :: Int -> Char -> (Int,Char)
404+tl_mapAccumR f z = L.mapAccumR f z `eqP` (second unpackS . TL.mapAccumR f z)
405+ where _types = f :: Int -> Char -> (Int,Char)
414406
415407replicate n l = concat (L.replicate n l)
416408
@@ -520,18 +512,16 @@ t_findAppendId (NotEmpty s) = unsquare $ \ts ->
520512tl_findAppendId (NotEmpty s) = unsquare $ \ts ->
521513 let t = TL.intercalate s ts
522514 in all (==t) $ map (uncurry TL.append) (TL.find s t)
523−t_findContains (NotEmpty s) = unsquare $ all (T.isPrefixOf s . snd) . T.find s .
524− T.intercalate s
525−tl_findContains (NotEmpty s) = unsquare $ all (TL.isPrefixOf s . snd) .
526− TL.find s . TL.intercalate s
515+t_findContains (NotEmpty s) = all (T.isPrefixOf s . snd) . T.find s .
516+ T.intercalate s
517+tl_findContains (NotEmpty s) = all (TL.isPrefixOf s . snd) .
518+ TL.find s . TL.intercalate s
527519sl_filterCount c = (L.genericLength . L.filter (==c)) `eqP` SL.countChar c
528520t_findCount s = (L.length . T.find s) `eq` T.count s
529521tl_findCount s = (L.genericLength . TL.find s) `eq` TL.count s
530522
531−t_split_split s = unsquare $
532− (T.split s `eq` Slow.split s) . T.intercalate s
533−tl_split_split s = unsquare $
534− ((TL.split (TL.fromStrict s) . TL.fromStrict) `eq`
523+t_split_split s = (T.split s `eq` Slow.split s) . T.intercalate s
524+tl_split_split s = ((TL.split (TL.fromStrict s) . TL.fromStrict) `eq`
535525 (map TL.fromStrict . T.split s)) . T.intercalate s
536526t_split_i (NotEmpty t) = id `eq` (T.intercalate t . T.split t)
537527tl_split_i (NotEmpty t) = id `eq` (TL.intercalate t . TL.split t)
@@ -574,10 +564,10 @@ t_lines' = lines' `eqP` (map unpackS . T.lines')
574564t_words = L.words `eqP` (map unpackS . T.words)
575565
576566tl_words = L.words `eqP` (map unpackS . TL.words)
577−t_unlines = unsquare (L.unlines `eq` (unpackS . T.unlines . map packS))
578−tl_unlines = unsquare (L.unlines `eq` (unpackS . TL.unlines . map packS))
579−t_unwords = unsquare (L.unwords `eq` (unpackS . T.unwords . map packS))
580−tl_unwords = unsquare (L.unwords `eq` (unpackS . TL.unwords . map packS))
567+t_unlines = L.unlines `eq` (unpackS . T.unlines . map packS)
568+tl_unlines = L.unlines `eq` (unpackS . TL.unlines . map packS)
569+t_unwords = L.unwords `eq` (unpackS . T.unwords . map packS)
570+tl_unwords = L.unwords `eq` (unpackS . TL.unwords . map packS)
581571
582572s_isPrefixOf s = L.isPrefixOf s `eqP`
583573 (S.isPrefixOf (S.stream $ packS s) . S.stream)
@@ -635,13 +625,12 @@ sf_zipWith p c s = (L.zipWith c (L.filter p s) . L.filter p) `eqP`
635625t_zipWith c s = L.zipWith c s `eqP` (unpackS . T.zipWith c (packS s))
636626tl_zipWith c s = L.zipWith c s `eqP` (unpackS . TL.zipWith c (packS s))
637627
638−t_indices = unsquare (\(NotEmpty s) -> Slow.indices s `eq` indices s)
639−tl_indices = unsquare (\(NotEmpty s) -> lazyIndices s `eq` S.indices s)
640− where lazyIndices s t = map fromIntegral $ Slow.indices (conc s) (conc t)
628+t_indices (NotEmpty s) = Slow.indices s `eq` indices s
629+tl_indices (NotEmpty s) = lazyIndices s `eq` S.indices s
630+ where lazyIndices ss t = map fromIntegral $ Slow.indices (conc ss) (conc t)
641631 conc = T.concat . TL.toChunks
642−t_indices_occurs (NotEmpty t) = unsquare $ \ts ->
643− let s = T.intercalate t ts
644− in Slow.indices t s == indices t s
632+t_indices_occurs (NotEmpty t) ts = let s = T.intercalate t ts
633+ in Slow.indices t s == indices t s
645634
646635-- Bit shifts.
647636shiftL w = forAll (choose (0,width-1)) $ \k -> Bits.shiftL w k == U.shiftL w k