January 2019
Intermediate to advanced
376 pages
8h 49m
English
Your answer could be any three of these strategies:
Two example solutions:
| | Erlang code/ThinkingInProperties/erlang/pbt/test/prop_solutions.erl |
| | %% @doc this function tests that any lists of `{Key,Val}' pairs |
| | %% end up being able to be sorted by the key by using `lists:keysort/2'. |
| | prop_keysort1() -> |
| | ?FORALL(List, list({term(),term()}), |
| | begin |
| | %% is_key_ordered checks that all tuples' keys are ordered. |
| | is_key_ordered(lists:keysort(1, List)) |
| | end). |
| |