diff --git a/infer/tests/codetoanalyze/erlang/compiler/issues.exp b/infer/tests/codetoanalyze/erlang/compiler/issues.exp index 2bbd15dcb39..c524add5022 100644 --- a/infer/tests/codetoanalyze/erlang/compiler/issues.exp +++ b/infer/tests/codetoanalyze/erlang/compiler/issues.exp @@ -661,7 +661,11 @@ nonmatch_match_expr:fn_test_match_func_arg_Bad/0: badmatch nonmatch_match_expr:fn_test_match_func_args_Bad/0: badmatch nonmatch_match_expr:fn_test_match_with_var_Bad/0: badmatch nonmatch_match_expr:fn_test_match_with_var_swapped_Bad/0: badmatch +nonmatch_match_expr:fn_test_not_real_anon_match1_Bad/0: badmatch +nonmatch_match_expr:fn_test_not_real_anon_match2_Bad/0: badmatch +nonmatch_match_expr:fn_test_simple_match_Bad/0: badmatch nonmatch_match_expr:test_match_a_Ok/0: ok +nonmatch_match_expr:test_match_anonymus_Ok/0: ok nonmatch_match_expr:test_match_b_Bad/0: badmatch nonmatch_match_expr:test_match_c_Ok/0: ok nonmatch_match_expr:test_match_d_Ok/0: ok diff --git a/infer/tests/codetoanalyze/erlang/pulse/nonmatch/nonmatch_match_expr.erl b/infer/tests/codetoanalyze/erlang/pulse/nonmatch/nonmatch_match_expr.erl index 64d5f328745..3d96992101b 100644 --- a/infer/tests/codetoanalyze/erlang/pulse/nonmatch/nonmatch_match_expr.erl +++ b/infer/tests/codetoanalyze/erlang/pulse/nonmatch/nonmatch_match_expr.erl @@ -31,7 +31,11 @@ test_match_with_var_Ok/0, fn_test_match_with_var_Bad/0, test_match_with_var_swapped_Ok/0, - fn_test_match_with_var_swapped_Bad/0 + fn_test_match_with_var_swapped_Bad/0, + fn_test_simple_match_Bad/0, + test_match_anonymus_Ok/0, + fn_test_not_real_anon_match1_Bad/0, + fn_test_not_real_anon_match2_Bad/0 ]). tail([_ | Xs]) -> Xs. @@ -165,3 +169,21 @@ test_match_with_var_swapped_Ok() -> fn_test_match_with_var_swapped_Bad() -> crash_if_not_one_with_var_swapped(2). + +fn_test_simple_match_Bad() -> + A = 1, + A = 2. + +test_match_anonymus_Ok() -> + _ = 1, + _ = 2. + +fn_test_not_real_anon_match1_Bad() -> + % `_` is the only truly anonymus name + _A = 1, + _A = 2. + +fn_test_not_real_anon_match2_Bad() -> + % `_` is the only truly anonymus name + __ = 1, + __ = 2.