Skip to content

Commit 6b562a2

Browse files
committed
Cleanup (and rename) test for handling symbolic states with improper lists
1 parent 6ed0011 commit 6b562a2

File tree

4 files changed

+42
-31
lines changed

4 files changed

+42
-31
lines changed

THANKS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ pull requests that have been incorporated in PropEr's code base:
1818
15. Pino Toscano
1919
16. Garret Smith
2020
17. Michael Uvarov
21+
18. Magnus Lång
22+
19. Manuel Cherep
23+
20. Matthias Kretschmer
2124

2225
We sincerely thank them for making PropEr a better tool.
2326

test/improper_lists_statem.erl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
%%---------------------------------------------------------------------
2+
%% From Matthias Kretschmer
3+
%%
4+
%% I encountered the problem that I cannot have improper lists in my
5+
%% symbolic state. As I like to use a dictionary which might include
6+
%% improper lists, I made this little fix (#102).
7+
%%---------------------------------------------------------------------
8+
-module(improper_lists_statem).
9+
-export([command/1, initial_state/0, next_state/3,
10+
precondition/2, postcondition/3, foo/1]).
11+
12+
-include_lib("proper/include/proper.hrl").
13+
14+
command(_State) ->
15+
return({call, ?MODULE, foo, [[a|b]]}).
16+
17+
initial_state() ->
18+
state.
19+
20+
next_state(State, _, _) ->
21+
State.
22+
23+
precondition(_, _) ->
24+
true.
25+
26+
postcondition(_, _, _) ->
27+
true.
28+
29+
foo(_Something) ->
30+
ok.
31+
32+
prop_simple() ->
33+
?FORALL(Cmds, commands(?MODULE),
34+
begin
35+
{_H,_S,Res} = run_commands(?MODULE, Cmds),
36+
equals(Res, ok)
37+
end).

test/lists_statem.erl

Lines changed: 0 additions & 29 deletions
This file was deleted.

test/proper_tests.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,13 +885,13 @@ true_props_test_() ->
885885
{three, conjunction([{a,true},{b,true}])}
886886
])),
887887
?_passes(?FORALL(X, untyped(), is_record(X, untyped))),
888+
?_passes(improper_lists_statem:prop_simple()),
888889
?_passes(pdict_statem:prop_pdict()),
889890
?_passes(symb_statem:prop_simple()),
890891
{timeout, 20, ?_passes(symb_statem:prop_parallel_simple())},
891892
{timeout, 10, ?_passes(ets_statem:prop_ets())},
892893
{timeout, 20, ?_passes(ets_statem:prop_parallel_ets())},
893-
{timeout, 20, ?_passes(pdict_fsm:prop_pdict())},
894-
?_passes(lists_statem:prop_simple())].
894+
{timeout, 20, ?_passes(pdict_fsm:prop_pdict())}].
895895

896896
false_props_test_() ->
897897
[?_failsWith([[_Same,_Same]],

0 commit comments

Comments
 (0)