Commits

Bryan O'Sullivan committed 57f47e1

Add a splitWith/count comparison property.

Comments (0)

Files changed (1)

tests/Properties.hs

 prop_TL_split_i c      = id `eq` (TL.intercalate (TL.singleton c) . TL.split c)
 
 prop_T_splitWith p     = splitWith p `eqP` (map unpackS . T.splitWith p)
+prop_T_splitWith_count c = (L.length . T.splitWith (==c)) `eq` ((1+) . T.count c)
 prop_T_splitWith_split c = T.splitWith (==c) `eq` T.split (T.singleton c)
 prop_TL_splitWith p    = splitWith p `eqP` (map unpackS . TL.splitWith p)
 
   ("prop_T_splitTimesEnd_i", mytest prop_T_splitTimesEnd_i),
   ("prop_TL_split_i", mytest prop_TL_split_i),
   ("prop_T_splitWith", mytest prop_T_splitWith),
+  ("prop_T_splitWith_count", mytest prop_T_splitWith_count),
   ("prop_T_splitWith_split", mytest prop_T_splitWith_split),
   ("prop_TL_splitWith", mytest prop_TL_splitWith),
   ("prop_T_chunksOf_same_lengths", mytest prop_T_chunksOf_same_lengths),