@@ -385,6 +385,22 @@ takeWhile1 =
386 predicate = (== 0)
386 predicate = (== 0)
391+ ((,,) <$> chooseInt (min_value, max_value)
392+ <*> chooseInt (min_value, max_value)
393+ <*> listOf (chooseInt (0, 1)))
395+ case S.parse (P.choice [parser i, parser j]) (S.fromList ls) of
396+ Right parsed_list ->
397+ checkListEqual parsed_list $ take (min i j) ls
398+ Left _ -> property False
402+ parser i = P.fromFold (FL.take i FL.toList)
388groupBy :: Property
404groupBy :: Property
390 forAll (listOf (chooseInt (0, 1)))
406 forAll (listOf (chooseInt (0, 1)))
@@ -401,7 +417,6 @@ groupBy =
401 | null lst = []
417 | null lst = []
402 | otherwise = head $ List.groupBy cmp lst
418 | otherwise = head $ List.groupBy cmp lst
405wordBy :: Property
420wordBy :: Property
407 forAll (listOf (elements [' ', 's']))
422 forAll (listOf (elements [' ', 's']))
@@ -755,6 +770,7 @@ main =
755 prop ("P.takeP = Prelude.take") takeP
770 prop ("P.takeP = Prelude.take") takeP
756 prop "P.groupBy = Prelude.head . Prelude.groupBy" groupBy
771 prop "P.groupBy = Prelude.head . Prelude.groupBy" groupBy
757 prop "many (P.wordBy ' ') = words'" wordBy
772 prop "many (P.wordBy ' ') = words'" wordBy
773+ prop "choice" choice
758 -- prop "" splitWithPass
774 -- prop "" splitWithPass
759 -- prop "" splitWithFailLeft
775 -- prop "" splitWithFailLeft
760 -- prop "" splitWithFailRight
776 -- prop "" splitWithFailRight