File 2061-Strengthen-test-case-added-in-8b83bc0b.patch of Package erlang
From 3060758b3c88994eee5a4be8d3f29eded81eb201 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Fri, 19 Aug 2016 14:47:40 +0200
Subject: [PATCH 1/2] Strengthen test case added in 8b83bc0b
Don't only test the case that failed; test it exhaustively.
---
lib/compiler/test/match_SUITE.erl | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl
index 127679b..52b2da0 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;
--
2.9.3