Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add regress test case about the `catchall' bug fix

  • Loading branch information...
commit 6a127d2ed16163240c6254166e66df6dd6e083ed 1 parent 645ccee
@iliastsi iliastsi authored
View
1  testsuite/suites/regress/results/receive_catchall-test1-inf.txt
@@ -0,0 +1 @@
+Checked 1 interleaving(s). No errors found.
View
1  testsuite/suites/regress/results/receive_catchall-test2-inf.txt
@@ -0,0 +1 @@
+Checked 1 interleaving(s). No errors found.
View
1  testsuite/suites/regress/results/receive_catchall-test3-inf.txt
@@ -0,0 +1 @@
+Checked 1 interleaving(s). No errors found.
View
40 testsuite/suites/regress/src/receive_catchall.erl
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.