From e4b486d24fcc5029b26fe576b9e373fc02b9098a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 30 Nov 2017 15:32:05 +0100 Subject: bs_match_SUITE: Cover more clauses in v3_codegen:bs_rename_ctx/4 --- lib/compiler/test/bs_match_SUITE.erl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index e6fa80e143..39f9b5d063 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -40,7 +40,7 @@ map_and_binary/1,unsafe_branch_caching/1, bad_literals/1,good_literals/1,constant_propagation/1, parse_xml/1,get_payload/1,escape/1,num_slots_different/1, - check_bitstring_list/1]). + check_bitstring_list/1,guard/1]). -export([coverage_id/1,coverage_external_ignore/2]). @@ -73,7 +73,7 @@ groups() -> map_and_binary,unsafe_branch_caching, bad_literals,good_literals,constant_propagation,parse_xml, get_payload,escape,num_slots_different, - check_bitstring_list]}]. + check_bitstring_list,guard]}]. init_per_suite(Config) -> @@ -1587,6 +1587,18 @@ check_bitstring_list(<<>>, []) -> check_bitstring_list(_, _) -> false. +guard(_Config) -> + Tuple = id({a,b}), + ok = guard_1(<<1,2,3>>, {1,2,3}), + + ok. + +%% Cover handling of #k_put{} in v3_codegen:bsm_rename_ctx/4. + +guard_1(<>, Tuple) when Tuple =:= {A,B,C} -> + ok. + + check(F, R) -> R = F(). -- cgit v1.2.3