diff --git a/tests/Tests/Properties/Text.hs b/tests/Tests/Properties/Text.hs index 8f9cbd00b59f8fcaa0e2ad537b1e664de5c1e998..936e1958e3d0399139c3a95511eba6123e674d13 100644 --- a/tests/Tests/Properties/Text.hs +++ b/tests/Tests/Properties/Text.hs @@ -237,7 +237,6 @@ t_indices_occurs = \(Sqrt (NotEmpty t)) ts -> t_indices_drop5 = T.indices (T.pack "no") (T.drop 5 (T.pack "abcdefghijklmno")) === [8] tl_indices_drop5 = S.indices (TL.pack "no") (TL.drop 5 (TL.pack "abcdefghijklmno")) === [8] -tl_indices_chunked = S.indices (TL.pack "1234") (TL.pack "1" `TL.append` TL.pack "234" `TL.append` TL.pack "567") === [0] t_indices_drop n s pref suff = T.indices s t === Slow.indices s t where @@ -247,6 +246,13 @@ tl_indices_drop n s pref suff = where t = TL.drop n $ pref `TL.append` s `TL.append` suff +tl_indices_chunked = S.indices (TL.pack "1234") (TL.pack "1" `TL.append` TL.pack "234" `TL.append` TL.pack "567") === [0] +tl_indices_drop_chunked n s pref suff = + map fromIntegral (S.indices s t) === Slow.indices (TL.toStrict s) (TL.toStrict t) + where + -- constructing a pathologically chunked haystack + t = TL.concatMap TL.singleton $ TL.drop n $ pref `TL.append` s `TL.append` suff + t_indices_char_drop n c pref suff = T.indices s t === Slow.indices s t where s = T.singleton c @@ -378,6 +384,7 @@ testText = testProperty "t_indices_drop" t_indices_drop, testProperty "tl_indices_drop" tl_indices_drop, testProperty "tl_indices_chunked" tl_indices_chunked, + testProperty "tl_indices_drop_chunked" tl_indices_drop_chunked, testProperty "t_indices_char_drop" t_indices_char_drop, testProperty "tl_indices_char_drop" tl_indices_char_drop ],