aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/test/cover_SUITE_data/b.erl
diff options
context:
space:
mode:
authorJosé Valim <[email protected]>2014-10-23 09:59:30 -0200
committerJosé Valim <[email protected]>2014-11-08 17:07:26 -0300
commitb7740a6fe01d254d79291bbcbbc853e874eb41ef (patch)
tree9bc148e803ce6e4da79797dd967e7915555ac1f6 /lib/tools/test/cover_SUITE_data/b.erl
parent8304aeb0114e61e8f694a58cf9e91a00856c3fe5 (diff)
downloadotp-b7740a6fe01d254d79291bbcbbc853e874eb41ef.tar.gz
otp-b7740a6fe01d254d79291bbcbbc853e874eb41ef.tar.bz2
otp-b7740a6fe01d254d79291bbcbbc853e874eb41ef.zip
Fix cover bug on last expressions with empty clauses
OTP-8188 introduced a fix for handling last expressions in expressions like case, try and friends. However the fix did not account that some of those expressions like receive may have no clauses (only an after clause), leading to a function clause error when cover compiling code with such expressions.
Diffstat (limited to 'lib/tools/test/cover_SUITE_data/b.erl')
-rw-r--r--lib/tools/test/cover_SUITE_data/b.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/tools/test/cover_SUITE_data/b.erl b/lib/tools/test/cover_SUITE_data/b.erl
index 13f39b8cb9..0a418a58d8 100644
--- a/lib/tools/test/cover_SUITE_data/b.erl
+++ b/lib/tools/test/cover_SUITE_data/b.erl
@@ -1,5 +1,5 @@
-module(b).
--export([start/0, loop/0]).
+-export([start/0, loop/0, wait/0]).
start() ->
spawn(?MODULE, loop, []).
@@ -12,3 +12,9 @@ loop() ->
stop ->
done
end.
+
+%% This checks for a bug in expressions which have no
+%% "main" clauses (only after and friends) followed by
+%% a return value in the same line.
+wait() ->
+ receive after 1000 -> done end, ok.