Skip to content

Instantly share code, notes, and snippets.

@moonpolysoft
Created July 31, 2009 22:23
Show Gist options
  • Save moonpolysoft/159479 to your computer and use it in GitHub Desktop.
Save moonpolysoft/159479 to your computer and use it in GitHub Desktop.
-define(assertRecv(Pattern, Timeout),
((fun () ->
receive V = Pattern -> V
after Timeout ->
receive __X ->
.erlang:error({assertRecv_failed,
[{module, ?MODULE},
{line, ?LINE},
{pattern, (??Pattern)},
{received, __X}]})
after 0 ->
.erlang:error({assertRecv_failed,
[{module, ?MODULE},
{line, ?LINE},
{pattern, (??Pattern)}]})
end
end
end)())).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment