if one date is in the past, the function should return false. I see that
Arb.localDate
takes a min and max date, but what I’d like is to have a mix of valid and invalid dates, or empty list. How would I setup that property test?
Shouldn’t this pass?
Hey @Emil Kantis, thanks for the reply. I’m not sure I follow. Can you please explain how this would work for my use case? Basically I want a list of dates as an input with at least one date in the past.
Srki Rakic
07/08/2021, 12:33 PM
Also I believe the test I posted should pass, but it doesn’t. For some reason, it still generates a list that has all dates in the future.
e
Emil Kantis
07/08/2021, 1:21 PM
forAll
means that every arbitrarily generated list must pass the condition. You have 2 list generators, one which will always generate 1-6 dates before today, and one which will generate 0-6 dates after today. The last generator will generate failing inputs
s
Srki Rakic
07/08/2021, 1:57 PM
Got it. So Maybe I’m misunderstanding how merge works. I though that there will be only one list generated from both generators (list1 + list2).