aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-08-19 14:47:40 +0200
committerBjörn Gustavsson <[email protected]>2016-08-19 15:03:43 +0200
commit3060758b3c88994eee5a4be8d3f29eded81eb201 (patch)
tree66afba0cd140ce33bb72e0186208e8c586cc8e38
parent2bb55f7bb6c8aa534d84087da18736e431bb482b (diff)
downloadotp-3060758b3c88994eee5a4be8d3f29eded81eb201.tar.gz
otp-3060758b3c88994eee5a4be8d3f29eded81eb201.tar.bz2
otp-3060758b3c88994eee5a4be8d3f29eded81eb201.zip
Strengthen test case added in 8b83bc0b
Don't only test the case that failed; test it exhaustively.
-rw-r--r--lib/compiler/test/match_SUITE.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl
index 127679ba69..52b2da05f7 100644
--- a/lib/compiler/test/match_SUITE.erl
+++ b/lib/compiler/test/match_SUITE.erl
@@ -576,7 +576,15 @@ grab_bag_remove_failure([{stretch,_,Mi}=Stretch | Specs], Unit, _MaxFailure) ->
%% Regression in 19.0, reported by Alexei Sholik
literal_binary(_Config) ->
- 3 = literal_binary_match(bar,<<"y">>),
+ 3 = literal_binary_match(bar, <<"y">>),
+
+ %% While we are at it, also test the remaining code paths
+ %% in literal_binary_match/2.
+ 1 = literal_binary_match(bar, <<"x">>),
+ 2 = literal_binary_match(foo, <<"x">>),
+ 3 = literal_binary_match(foo, <<"y">>),
+ fail = literal_binary_match(bar, <<"z">>),
+ fail = literal_binary_match(foo, <<"z">>),
ok.
literal_binary_match(bar, <<"x">>) -> 1;