@@ -264,8 +264,15 @@ t_toUpper_upper t = p (T.toUpper t) >= p t
264tl_toUpper_upper t = p (TL.toUpper t) >= p t
264tl_toUpper_upper t = p (TL.toUpper t) >= p t
265 where p = TL.length . TL.filter isUpper
265 where p = TL.length . TL.filter isUpper
267−justifyLeft k c s = s ++ L.replicate (k - length s) c
267+justifyLeft k c xs = xs ++ L.replicate (k - length xs) c
268−justifyRight m n s = L.replicate (m - length s) n ++ s
268+justifyRight m n xs = L.replicate (m - length xs) n ++ xs
271+ | otherwise = L.replicate l c ++ xs ++ L.replicate r c
272+ where len = length xs
270s_justifyLeft k c = justifyLeft j c `eqP` (unpackS . S.justifyLeftI j c)
277s_justifyLeft k c = justifyLeft j c `eqP` (unpackS . S.justifyLeftI j c)
271 where j = fromIntegral (k :: Word8)
278 where j = fromIntegral (k :: Word8)
@@ -282,6 +289,10 @@ t_justifyRight k c = justifyRight j c `eqP` (unpackS . T.justifyRight j c)
282 where j = fromIntegral (k :: Word8)
289 where j = fromIntegral (k :: Word8)
283tl_justifyRight k c = justifyRight j c `eqP` (unpackS . TL.justifyRight (fromIntegral j) c)
290tl_justifyRight k c = justifyRight j c `eqP` (unpackS . TL.justifyRight (fromIntegral j) c)
284 where j = fromIntegral (k :: Word8)
291 where j = fromIntegral (k :: Word8)
292+t_center k c = center j c `eqP` (unpackS . T.center j c)
293+ where j = fromIntegral (k :: Word8)
294+tl_center k c = center j c `eqP` (unpackS . TL.center (fromIntegral j) c)
295+ where j = fromIntegral (k :: Word8)
286sf_foldl p f z = (L.foldl f z . L.filter p) `eqP` (S.foldl f z . S.filter p)
297sf_foldl p f z = (L.foldl f z . L.filter p) `eqP` (S.foldl f z . S.filter p)
287 where _types = f :: Char -> Char -> Char
298 where _types = f :: Char -> Char -> Char
@@ -810,7 +821,9 @@ tests = [
810 testProperty "t_justifyLeft" t_justifyLeft,
821 testProperty "t_justifyLeft" t_justifyLeft,
811 testProperty "tl_justifyLeft" tl_justifyLeft,
822 testProperty "tl_justifyLeft" tl_justifyLeft,
812 testProperty "t_justifyRight" t_justifyRight,
823 testProperty "t_justifyRight" t_justifyRight,
813− testProperty "tl_justifyRight" tl_justifyRight
824+ testProperty "tl_justifyRight" tl_justifyRight,
825+ testProperty "t_center" t_center,
826+ testProperty "tl_center" tl_center