Commits

Bryan O'Sullivan  committed 569197b

Cover justifyLeft on streams.

  • Participants
  • Parent commits 359abdc

Comments (0)

Files changed (2)

File Data/Text.hs

     | len <= 0  = Nothing
     | otherwise = Just (c, textP arr (off+d) (len-d))
     where (c,d) = iter t 0
-{-# INLINE uncons #-}
+{-# INLINE [1] uncons #-}
 
 -- | Lifted from Control.Arrow and specialized.
 second :: (b -> c) -> (a,b) -> (a,c)

File tests/Properties.hs

 prop_T_toUpper_upper t = p (T.toUpper t) >= p t
     where p = T.length . T.filter isUpper
 
-prop_T_justifyLeft k c = jl k c `eqP` (unpackS . T.justifyLeft k c)
-    where jl k c s = s ++ replicate (k - length s) c
+justifyLeft k c s = s ++ replicate (k - length s) c
+
+prop_S_justifyLeft k c = justifyLeft k c `eqP` (unpackS . S.justifyLeft k c)
+prop_T_justifyLeft k c = justifyLeft k c `eqP` (unpackS . T.justifyLeft k c)
 prop_T_justifyRight k c = jr k c `eqP` (unpackS . T.justifyRight k c)
     where jr k c s = replicate (k - length s) c ++ s
 
   ("prop_T_toUpper_length", mytest prop_T_toUpper_length),
   ("prop_T_toUpper_upper", mytest prop_T_toUpper_upper),
 
+  ("prop_S_justifyLeft", mytest prop_S_justifyLeft),
   ("prop_T_justifyLeft", mytest prop_T_justifyLeft),
   ("prop_T_justifyRight", mytest prop_T_justifyRight),