Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow the peak observation.

  • Loading branch information...
commit 43c25c7fb9cb404dfa3128895fb1a4d3aa24a9bf 1 parent d18c6a6
@jlouis authored
Showing with 6 additions and 0 deletions.
  1. +1 −0  test/jobs_eqc_queue.erl
  2. +5 −0 test/jobs_queue_model.erl
View
1  test/jobs_eqc_queue.erl
@@ -44,6 +44,7 @@ g_info() ->
obs() ->
Q = g_queue(),
oneof([{call, jobs_queue, all, [Q]},
+ {call, jobs_queue, peek, [Q]},
{call, jobs_queue, info, [g_info(), Q]},
{call, jobs_queue, is_empty, [Q]}]).
View
5 test/jobs_queue_model.erl
@@ -16,6 +16,11 @@ info(max_time, #queue { max_time = MT}) -> MT;
info(length, #queue { st = Q}) ->
queue:len(Q).
+peek(#queue { st = Q }) ->
+ case queue:peek(Q) of
+ empty -> undefined;
+ {value, K} -> K
+ end.
all(#queue { st = Q}) ->
queue:to_list(Q).
Please sign in to comment.
Something went wrong with that request. Please try again.