diff options
author | Björn Gustavsson <bjorn@erlang.org> | 2017-11-25 08:50:47 +0100 |
---|---|---|
committer | Björn Gustavsson <bjorn@erlang.org> | 2017-11-27 10:20:18 +0100 |
commit | 756fc181cf8835268bf9e3b963dcda294e0ff2a3 (patch) | |
tree | ff2c0d5a6b5b84148832ef28f965423cfab2fd77 /lib | |
parent | 5b0ba5e5f09d65cb15d00f8e089f5d98c5734d1a (diff) | |
download | otp-756fc181cf8835268bf9e3b963dcda294e0ff2a3.tar.gz otp-756fc181cf8835268bf9e3b963dcda294e0ff2a3.tar.bz2 otp-756fc181cf8835268bf9e3b963dcda294e0ff2a3.zip |
Add test to cover a line in v3_kernel:opt_single_valued/3
The uncovered line was added in 6753bbcc3fdb0.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compiler/test/match_SUITE.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index c31695be24..35d2e8e91a 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -617,6 +617,10 @@ grab_bag(_Config) -> {bad,16#555555555555555555555555555555555555555555555555555}], ok = grab_bag_remove_failure(L, unit, 0), + {42,<<43,44>>} = grab_bag_single_valued(<<42,43,44>>), + empty_list = grab_bag_single_valued([]), + empty_tuple = grab_bag_single_valued({}), + ok. grab_bag_remove_failure([], _Unit, _MaxFailure) -> @@ -634,6 +638,12 @@ grab_bag_remove_failure([{stretch,_,Mi}=Stretch | Specs], Unit, _MaxFailure) -> ok end. +%% Cover a line v3_kernel that places binary matching first. +grab_bag_single_valued(<<H,T/bytes>>) -> {H,T}; +grab_bag_single_valued([]) -> empty_list; +grab_bag_single_valued({}) -> empty_tuple. + + %% Regression in 19.0, reported by Alexei Sholik literal_binary(_Config) -> 3 = literal_binary_match(bar, <<"y">>), |