@@ -13,7 +13,6 @@ import Debug.Trace (trace)
1313import Control.Arrow ((***), second)
1414import Data.Word (Word8, Word16, Word32)
1515import qualified Data.Text as T
16−import qualified Data.Text.Compat as C
1716import qualified Data.Text.Lazy as TL
1817import qualified Data.Text.Encoding as E
1918import Control.Exception (SomeException, try)
@@ -23,6 +22,7 @@ import qualified Data.Text.Lazy.Encoding as EL
2322import qualified Data.Text.Lazy.Fusion as SL
2423import qualified Data.Text.UnsafeShift as U
2524import qualified Data.List as L
25+import Prelude hiding (replicate)
2626import System.IO.Unsafe (unsafePerformIO)
2727import Test.Framework (defaultMain, testGroup)
2828import Test.Framework.Providers.QuickCheck (testProperty)
@@ -238,8 +238,8 @@ t_toUpper_upper t = p (T.toUpper t) >= p t
238238tl_toUpper_upper t = p (TL.toUpper t) >= p t
239239 where p = TL.length . TL.filter isUpper
240240
241−justifyLeft k c s = s ++ replicate (k - length s) c
242−justifyRight m n s = replicate (m - length s) n ++ s
241+justifyLeft k c s = s ++ L.replicate (k - length s) c
242+justifyRight m n s = L.replicate (m - length s) n ++ s
243243
244244s_justifyLeft k c = justifyLeft k c `eqP` (unpackS . S.justifyLeftI k c)
245245sf_justifyLeft p k c =
@@ -315,8 +315,12 @@ t_mapAccumR f z = unsquare (L.mapAccumR f z `eqP` (second unpackS . T.mapAccum
315315tl_mapAccumR f z = unsquare (L.mapAccumR f z `eqP` (second unpackS . TL.mapAccumR f z))
316316 where _types = f :: Int -> Char -> (Int,Char)
317317
318−t_replicate n = L.replicate n `eq` (unpackS . T.replicate n)
319−tl_replicate n = L.replicate n `eq` (unpackS . TL.replicate (fromIntegral n))
318+replicate n l = concat (L.replicate n l)
319+
320+t_replicate n = replicate n `eq` (unpackS . T.replicate n . packS)
321+tl_replicate n = replicate n `eq` (unpackS . TL.replicate (fromIntegral n) . packS)
322+t_replicateChar n = L.replicate n `eq` (unpackS . T.replicateChar n)
323+tl_replicateChar n= L.replicate n `eq` (unpackS . TL.replicateChar (fromIntegral n))
320324
321325unf :: Int -> Char -> Maybe (Char, Char)
322326unf n c | fromEnum c * 100 > n = Nothing
@@ -393,7 +397,6 @@ tl_split_i t = id `eq` (TL.intercalate t . TL.split t)
393397t_splitWith p = splitWith p `eqP` (map unpackS . T.splitWith p)
394398t_splitWith_count c = (L.length . T.splitWith (==c)) `eq` ((1+) . T.count c)
395399t_splitWith_split c = T.splitWith (==c) `eq` T.split (T.singleton c)
396−t_splitWith_Csplit c = T.splitWith (==c) `eq` C.split c
397400tl_splitWith p = splitWith p `eqP` (map unpackS . TL.splitWith p)
398401
399402splitWith :: (a -> Bool) -> [a] -> [[a]]
@@ -412,13 +415,6 @@ t_chunksOf_length k t = len == T.length t || (k <= 0 && len == 0)
412415
413416tl_chunksOf k = T.chunksOf k `eq` (map (T.concat . TL.toChunks) . TL.chunksOf (fromIntegral k) . TL.fromChunks . (:[]))
414417
415−t_breakSubstring_isInfixOf s l
416− = T.isInfixOf s l ==
417− T.null s || (not . T.null . snd $ C.breakSubstring s l)
418−t_breakSubstringC c
419− = L.break (==c) `eqP`
420− (unpack2 . C.breakSubstring (T.singleton c))
421−
422418t_lines = L.lines `eqP` (map unpackS . T.lines)
423419tl_lines = L.lines `eqP` (map unpackS . TL.lines)
424420{-
@@ -711,6 +707,8 @@ tests = [
711707 testGroup "unfolds" [
712708 testProperty "t_replicate" t_replicate,
713709 testProperty "tl_replicate" tl_replicate,
710+ testProperty "t_replicateChar" t_replicateChar,
711+ testProperty "tl_replicateChar" tl_replicateChar,
714712 testProperty "t_unfoldr" t_unfoldr,
715713 testProperty "tl_unfoldr" tl_unfoldr,
716714 testProperty "t_unfoldrN" t_unfoldrN,
@@ -776,13 +774,10 @@ tests = [
776774 testProperty "t_splitWith" t_splitWith,
777775 testProperty "t_splitWith_count" t_splitWith_count,
778776 testProperty "t_splitWith_split" t_splitWith_split,
779− testProperty "t_splitWith_Csplit" t_splitWith_Csplit,
780777 testProperty "tl_splitWith" tl_splitWith,
781778 testProperty "t_chunksOf_same_lengths" t_chunksOf_same_lengths,
782779 testProperty "t_chunksOf_length" t_chunksOf_length,
783− testProperty "tl_chunksOf" tl_chunksOf,
784− testProperty "t_breakSubstringC" t_breakSubstringC,
785− testProperty "t_breakSubstring_isInfixOf" t_breakSubstring_isInfixOf
780+ testProperty "tl_chunksOf" tl_chunksOf
786781 ],
787782
788783 testGroup "lines and words" [