Skip to content

Commit

Permalink
Add regress test case about the `catchall' bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iliastsi committed Sep 25, 2012
1 parent 645ccee commit 6a127d2
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checked 1 interleaving(s). No errors found.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checked 1 interleaving(s). No errors found.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checked 1 interleaving(s). No errors found.
40 changes: 40 additions & 0 deletions testsuite/suites/regress/src/receive_catchall.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
%%%----------------------------------------------------------------------
%%% Copyright (c) 2012, Alkis Gotovos <el3ctrologos@hotmail.com>,
%%% Maria Christakis <mchrista@softlab.ntua.gr>
%%% and Kostis Sagonas <kostis@cs.ntua.gr>.
%%% All rights reserved.
%%%
%%% This file is distributed under the Simplified BSD License.
%%% Details can be found in the LICENSE file.
%%%----------------------------------------------------------------------
%%% Authors : Ilias Tsitsimpis <iliastsi@hotmail.com>
%%% Description : A regress test case for the bug fix introduced
%%% in commit 645ccee1a61dd1c33681544d5e02c8a4b2be0c04
%%%----------------------------------------------------------------------

-module(receive_catchall).
-export([scenarios/0]).
-export([test1/0, test2/0, test3/0]).

scenarios() ->
[{test1, inf}, {test2, inf}, {test3, inf}].

%% This is ok.
test1() ->
self() ! hoho,
self() ! foo,
receive foo -> ok end.

%% This is ok.
test2() ->
Msg = foo,
self() ! foo,
self() ! hoho,
receive Msg -> ok end.

%% This used to fail.
test3() ->
Msg = foo,
self() ! hoho,
self() ! foo,
receive Msg -> ok end.

0 comments on commit 6a127d2

Please sign in to comment.