Erlang
(page 125
test/prop_generators.erl
Question 5
Note that in stamps1
generator no sorting by content occurs when comparing tuples. I tried to correct the lack of this check and wrote a check property on the basis of this.
%% Return two ordered timestamps
stamps1() ->
?SUCHTHAT({S1, S2}, {stamp(), stamp()},
begin
{H1,M1,SEK1} = S1,
{H2,M2,SEK2} = S2,
S1 =< S2 andalso H1 =< H2 andalso
M1 =< M2 andalso SEK1 =< SEK2
end
).