@@ -155,6 +155,19 @@ satisfy =
155155 where
156156 predicate = (>= mid_value)
157157
158+nextPass :: Property
159+nextPass =
160+ forAll (chooseInt (1, max_value)) $ \int ->
161+ property (case S.parse P.next (S.fromList [int]) of
162+ Right (Just i) -> i == int
163+ _ -> False)
164+
165+next :: Property
166+next =
167+ property (case S.parse P.next (S.fromList []) of
168+ Right Nothing -> True
169+ _ -> False)
170+
158171-- Sequence Parsers Tests
159172takeBetweenPass :: Property
160173takeBetweenPass =
@@ -745,6 +758,8 @@ main =
745758 prop "eof pass on []" eofPass
746759 prop "eof fail on non-empty list" eofFail
747760 prop "first element exists and >= mid_value" satisfyPass
761+ prop "next pass on [Int]" nextPass
762+ prop "next fail on []" next
748763 prop "check first element exists and satisfies predicate" satisfy
749764
750765 describe "test for sequence parser" $ do