@@ -403,7 +403,7 @@ wordBy =
403 parser = P.many (P.wordBy predicate FL.toList) FL.toList
403 parser = P.many (P.wordBy predicate FL.toList) FL.toList
404 words' lst =
404 words' lst =
405 let wrds = words lst
405 let wrds = words lst
406− in if wrds == [] then [""] else wrds
406+ in if wrds == [] && length lst > 0 then [""] else wrds
408-- splitWithPass :: Property
408-- splitWithPass :: Property
409-- splitWithPass =
409-- splitWithPass =
@@ -666,6 +666,20 @@ parseMany2Events =
667 in listEquals (==) xs (replicate 2 ev)
667 in listEquals (==) xs (replicate 2 ev)
669+manyEqParseMany :: Property
671+ forAll (listOf (chooseInt (0, 100))) $ \lst ->
672+ forAll (chooseInt (1, 100)) $ \i ->
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
681+ split i = P.fromFold (FL.take i FL.toList)
669-------------------------------------------------------------------------------
683-------------------------------------------------------------------------------
671-------------------------------------------------------------------------------
685-------------------------------------------------------------------------------
@@ -741,4 +755,5 @@ main =
741 prop ("P.some concatFold $ P.takeEndBy_ (== 1) FL.toList ="
755 prop ("P.some concatFold $ P.takeEndBy_ (== 1) FL.toList ="
742 ++ "Prelude.filter (== 0)") some
756 ++ "Prelude.filter (== 0)") some
743 -- prop "fail due to parser being die" someFail
757 -- prop "fail due to parser being die" someFail
758+ prop "P.many == S.parseMany" manyEqParseMany
744 takeProperties
759 takeProperties