on master help sign in
Tidy up tests to run in reasonable time
689bbefBryan O'Sullivan
tests/Properties.hs+31−16
@@ -252,14 +252,21 @@ tl_toUpper_upper t = p (TL.toUpper t) >= p t
252justifyLeft k c s = s ++ L.replicate (k - length s) c
252justifyLeft k c s = s ++ L.replicate (k - length s) c
253justifyRight m n s = L.replicate (m - length s) n ++ s
253justifyRight m n s = L.replicate (m - length s) n ++ s
254
254
255−s_justifyLeft k c = justifyLeft k c `eqP` (unpackS . S.justifyLeftI k c)
255+s_justifyLeft k c = justifyLeft j c `eqP` (unpackS . S.justifyLeftI j c)
256+ where j = fromIntegral (k :: Word8)
256−s_justifyLeft_s k c = justifyLeft k c `eqP` (unpackS . S.unstream . S.justifyLeftI k c)
257+s_justifyLeft_s k c = justifyLeft j c `eqP` (unpackS . S.unstream . S.justifyLeftI j c)
258+ where j = fromIntegral (k :: Word8)
257−sf_justifyLeft p k c =
259+sf_justifyLeft p k c = (justifyLeft j c . L.filter p) `eqP`
258− (justifyLeft k c . L.filter p) `eqP` (unpackS . S.justifyLeftI k c . S.filter p)
260+ (unpackS . S.justifyLeftI j c . S.filter p)
261+ where j = fromIntegral (k :: Word8)
259−t_justifyLeft k c = justifyLeft k c `eqP` (unpackS . T.justifyLeft k c)
262+t_justifyLeft k c = justifyLeft j c `eqP` (unpackS . T.justifyLeft j c)
263+ where j = fromIntegral (k :: Word8)
260−tl_justifyLeft k c = justifyLeft k c `eqP` (unpackS . TL.justifyLeft (fromIntegral k) c)
264+tl_justifyLeft k c = justifyLeft j c `eqP` (unpackS . TL.justifyLeft (fromIntegral j) c)
265+ where j = fromIntegral (k :: Word8)
261−t_justifyRight k c = justifyRight k c `eqP` (unpackS . T.justifyRight k c)
266+t_justifyRight k c = justifyRight j c `eqP` (unpackS . T.justifyRight j c)
267+ where j = fromIntegral (k :: Word8)
262−tl_justifyRight k c = justifyRight k c `eqP` (unpackS . TL.justifyRight (fromIntegral k) c)
268+tl_justifyRight k c = justifyRight j c `eqP` (unpackS . TL.justifyRight (fromIntegral j) c)
269+ where j = fromIntegral (k :: Word8)
263
270
264sf_foldl p f z = (L.foldl f z . L.filter p) `eqP` (S.foldl f z . S.filter p)
271sf_foldl p f z = (L.foldl f z . L.filter p) `eqP` (S.foldl f z . S.filter p)
265 where _types = f :: Char -> Char -> Char
272 where _types = f :: Char -> Char -> Char
@@ -330,19 +337,27 @@ tl_mapAccumR f z = unsquare (L.mapAccumR f z `eqP` (second unpackS . TL.mapAcc
330
337
331replicate n l = concat (L.replicate n l)
338replicate n l = concat (L.replicate n l)
332
339
333−t_replicate n = replicate n `eq` (unpackS . T.replicate n . packS)
340+t_replicate n = replicate m `eq` (unpackS . T.replicate m . packS)
341+ where m = fromIntegral (n :: Word8)
334−tl_replicate n = replicate n `eq` (unpackS . TL.replicate (fromIntegral n) . packS)
342+tl_replicate n = replicate m `eq` (unpackS . TL.replicate (fromIntegral m) . packS)
343+ where m = fromIntegral (n :: Word8)
335
344
336unf :: Int -> Char -> Maybe (Char, Char)
345unf :: Int -> Char -> Maybe (Char, Char)
337unf n c | fromEnum c * 100 > n = Nothing
346unf n c | fromEnum c * 100 > n = Nothing
338 | otherwise = Just (c, succ c)
347 | otherwise = Just (c, succ c)
339
348
340−t_unfoldr n = L.unfoldr (unf n) `eq` (unpackS . T.unfoldr (unf n))
349+t_unfoldr n = L.unfoldr (unf m) `eq` (unpackS . T.unfoldr (unf m))
350+ where m = fromIntegral (n :: Word16)
341−tl_unfoldr n = L.unfoldr (unf n) `eq` (unpackS . TL.unfoldr (unf n))
351+tl_unfoldr n = L.unfoldr (unf m) `eq` (unpackS . TL.unfoldr (unf m))
352+ where m = fromIntegral (n :: Word16)
342−t_unfoldrN n m = (L.take n . L.unfoldr (unf m)) `eq`
353+t_unfoldrN n m = (L.take i . L.unfoldr (unf j)) `eq`
343− (unpackS . T.unfoldrN n (unf m))
354+ (unpackS . T.unfoldrN i (unf j))
355+ where i = fromIntegral (n :: Word16)
356+ j = fromIntegral (m :: Word16)
344−tl_unfoldrN n m = (L.take n . L.unfoldr (unf m)) `eq`
357+tl_unfoldrN n m = (L.take i . L.unfoldr (unf j)) `eq`
345− (unpackS . TL.unfoldrN (fromIntegral n) (unf m))
358+ (unpackS . TL.unfoldrN (fromIntegral i) (unf j))
359+ where i = fromIntegral (n :: Word16)
360+ j = fromIntegral (m :: Word16)
346
361
347unpack2 :: (Stringy s) => (s,s) -> (String,String)
362unpack2 :: (Stringy s) => (s,s) -> (String,String)
348unpack2 = unpackS *** unpackS
363unpack2 = unpackS *** unpackS