@@ -535,14 +535,20 @@ noMatch = do
535535 d <- suchThat char (/= c)
536536 return (c,d)
537537t_takeWhile p = L.takeWhile p `eqP` (unpackS . T.takeWhile p)
538+t_takeWhile_null n c
539+ = T.null $ T.takeWhile (==c) (T.replicate n (T.singleton c))
538540tl_takeWhile p = L.takeWhile p `eqP` (unpackS . TL.takeWhile p)
541+tl_takeWhile_null n c
542+ = TL.null $
543+ TL.takeWhile (==c) (TL.replicate n (TL.singleton c))
539544t_takeWhileEnd p = (L.reverse . L.takeWhile p . L.reverse) `eqP`
540545 (unpackS . T.takeWhileEnd p)
541−t_takeWhileEnd_null n = forAll noMatch $ \(c,d) -> T.null $
542− T.takeWhileEnd (==d) (T.replicate n (T.singleton c))
546+t_takeWhileEnd_null t = forAll noMatch $ \(c,d) -> T.null $
547+ T.takeWhileEnd (==d) (T.snoc t c)
543548tl_takeWhileEnd p = (L.reverse . L.takeWhile p . L.reverse) `eqP`
544549 (unpackS . TL.takeWhileEnd p)
545− TL.takeWhileEnd (==d) (TL.replicate n (TL.singleton c))
550+tl_takeWhileEnd_null t = forAll noMatch $ \(c,d) -> TL.null $
551+ TL.takeWhileEnd (==d) (TL.snoc t c)
546552s_dropWhile p = L.dropWhile p `eqP` (unpackS . S.dropWhile p)
547553s_dropWhile_s p = L.dropWhile p `eqP` (unpackS . S.unstream . S.dropWhile p)
548554sf_dropWhile q p = (L.dropWhile p . L.filter q) `eqP`
@@ -1170,10 +1176,13 @@ tests =
11701176 testProperty "s_takeWhile_s" s_takeWhile_s,
11711177 testProperty "sf_takeWhile" sf_takeWhile,
11721178 testProperty "t_takeWhile" t_takeWhile,
1179+ testProperty "t_takeWhile_null" t_takeWhile_null,
11731180 testProperty "tl_takeWhile" tl_takeWhile,
1181+ testProperty "tl_takeWhile_null" tl_takeWhile_null,
11741182 testProperty "t_takeWhileEnd" t_takeWhileEnd,
11751183 testProperty "t_takeWhileEnd_null" t_takeWhileEnd_null,
11761184 testProperty "tl_takeWhileEnd" tl_takeWhileEnd,
1185+ testProperty "tl_takeWhileEnd_null" tl_takeWhileEnd_null,
11771186 testProperty "sf_dropWhile" sf_dropWhile,
11781187 testProperty "s_dropWhile" s_dropWhile,
11791188 testProperty "s_dropWhile_s" s_dropWhile_s,