Skip to content

Commit

Permalink
Quick cleanup of a couple things from eqc week.
Browse files Browse the repository at this point in the history
  • Loading branch information
massung committed Jan 25, 2012
1 parent d10f9cc commit a1e4651
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/eqc_routes.erl
Expand Up @@ -136,9 +136,11 @@ filter_validate_n (Size,Pages,_Page,Contents,Filter) ->
%% ---------------------------------------------------------------------------
%% eqc generators

%% valid authorization modes for app.config
g_auth () ->
oneof([userlist,none]).

%% username and password pairs (none = don't pass user/pass)
g_userpass () ->
oneof([{user,pass},
{user,bad_password},
Expand All @@ -147,28 +149,31 @@ g_userpass () ->
none % not passing auth data
]).

%% query string generator
g_qs () ->
?LET(Filter,g_filter(),
?LET(Page,g_page(),
Filter ++ Page)).

%% valid and invalid query string filters for ring page
g_filter () ->
oneof([oneof([[{filter,node}],
[{filter,node},{q,g_node()}],
[{q,g_node()}]
]),
oneof([[{filter,node}],
[{filter,node},{q,g_node()}],
[{q,g_node()}],
[{filter,handoffs}],
[{filter,fallbacks}],
[]
]).

%% pagination data for ring page
g_page () ->
oneof([[{n,int()},{p,int()}],
[{n,int()}],
[{p,int()}],
[]
]).

%% this node or a dummy node
g_node () ->
oneof([node(),'dummy@nohost']).

Expand Down

0 comments on commit a1e4651

Please sign in to comment.