@@ -296,6 +296,13 @@ testGroups =
296296 r <- run $ S.toList $ S.groups FL.toList $ S.fromList vec
297297 assert $ r == group vec
298298
299+testGroupsByRolling :: Property
300+testGroupsByRolling =
301+ forAll (choose (0, maxStreamLen)) $ \len ->
302+ forAll (vectorOf len (arbitrary :: Gen Int)) $ \vec -> monadicIO $ do
303+ r <- run $ S.toList $ S.groupsByRolling (==) FL.toList $ S.fromList vec
304+ assert $ r == group vec
305+
299306-- |
300307-- If the list is empty, returns Nothing,
301308-- else wraps the minimum value of the list in Just.
@@ -324,6 +331,13 @@ testGroupsBySep =
324331 $ S.fromList vec
325332 assert $ decreasing a == True
326333
334+groupingOps :: Spec
335+groupingOps = do
336+ prop "groupsBy" testGroupsBy
337+ prop "S.groups = groups" testGroups
338+ prop "S.groupsByRolling = groups" testGroupsByRolling
339+ prop "testGroupsBySep" testGroupsBySep
340+
327341associativityCheck
328342 :: String
329343 -> (SerialT IO Int -> SerialT IO Int)
@@ -567,10 +581,7 @@ main = hspec
567581 serialOps $ eliminationOpsOrdered S.fromFoldable "serially"
568582 serialOps $ eliminationOpsOrdered folded "serially folded"
569583
570− describe "Tests for S.groupsBy" $ do
571− prop "testGroupsBy" testGroupsBy
572− prop "S.groups = groups" testGroups
573− prop "testGroupsBySep" testGroupsBySep
584+ describe "Tests for S.groupsBy" groupingOps
574585
575586 describe "Composed MonadThrow serially" $ composeWithMonadThrow serially
576587