@@ -335,6 +335,25 @@ groupBy =
335 | null lst = []
335 | null lst = []
336 | otherwise = head $ List.groupBy cmp lst
336 | otherwise = head $ List.groupBy cmp lst
338+groupByRolling :: Property
340+ forAll (listOf (chooseInt (0, 1)))
342+ case S.parseD parser (S.fromList ls) of
343+ Right parsed -> checkListEqual parsed (groupByLF Nothing ls)
344+ Left _ -> property False
349+ parser = P.groupBy cmp FL.toList
351+ groupByLF Nothing (x:xs) = x : groupByLF (Just x) xs
352+ groupByLF (Just y) (x:xs) =
354+ then x : groupByLF (Just x) xs
338sliceSepByMax :: Property
357sliceSepByMax :: Property
339sliceSepByMax =
358sliceSepByMax =
340 forAll (chooseInt (min_value, max_value)) $ \n ->
359 forAll (chooseInt (min_value, max_value)) $ \n ->
@@ -696,6 +715,7 @@ main =
696 prop "P.takeWhile = Prelude.takeWhile" Main.takeWhile
715 prop "P.takeWhile = Prelude.takeWhile" Main.takeWhile
697 prop "P.takeWhile1 = Prelude.takeWhile if taken something, else check why failed" takeWhile1
716 prop "P.takeWhile1 = Prelude.takeWhile if taken something, else check why failed" takeWhile1
698 prop "P.groupBy = Prelude.head . Prelude.groupBy" groupBy
717 prop "P.groupBy = Prelude.head . Prelude.groupBy" groupBy
718+ prop "groupByRolling" groupByRolling
699 prop "P.sliceSepByMax = Prelude.take n (Prelude.takeWhile (not . predicate)" sliceSepByMax
719 prop "P.sliceSepByMax = Prelude.take n (Prelude.takeWhile (not . predicate)" sliceSepByMax
700 prop "many (P.wordBy ' ') = words'" wordBy
720 prop "many (P.wordBy ' ') = words'" wordBy
701 prop "parse 0, then 1, else fail" splitWith
721 prop "parse 0, then 1, else fail" splitWith