@@ -403,7 +403,7 @@ wordBy =
403403 parser = P.many (P.wordBy predicate FL.toList) FL.toList
404404 words' lst =
405405 let wrds = words lst
406− in if wrds == [] then [""] else wrds
406+ in if wrds == [] && length lst > 0 then [""] else wrds
407407
408408-- splitWithPass :: Property
409409-- splitWithPass =
@@ -666,6 +666,20 @@ parseMany2Events =
666666 }
667667 in listEquals (==) xs (replicate 2 ev)
668668
669+manyEqParseMany :: Property
670+manyEqParseMany =
671+ forAll (listOf (chooseInt (0, 100))) $ \lst ->
672+ forAll (chooseInt (1, 100)) $ \i ->
673+ monadicIO $ do
674+ let strm = S.fromList lst
675+ r1 <- run $ S.parse (P.many (split i) FL.toList) strm
676+ r2 <- run $ S.toList $ S.parseMany (split i) strm
677+ assert $ r1 == r2
678+
679+ where
680+
681+ split i = P.fromFold (FL.take i FL.toList)
682+
669683-------------------------------------------------------------------------------
670684-- Main
671685-------------------------------------------------------------------------------
@@ -741,4 +755,5 @@ main =
741755 prop ("P.some concatFold $ P.takeEndBy_ (== 1) FL.toList ="
742756 ++ "Prelude.filter (== 0)") some
743757 -- prop "fail due to parser being die" someFail
758+ prop "P.many == S.parseMany" manyEqParseMany
744759 takeProperties