Skip to content

Commit

Permalink
[erl-frontend] Add test for binary in attribute
Browse files Browse the repository at this point in the history
Summary: Add a test case for D64688517

Reviewed By: rgrig, mmarescotti

Differential Revision: D64696149

fbshipit-source-id: 878425da93bef66ad410ef005d8a17a97cc57bb1
  • Loading branch information
hajduakos authored and facebook-github-bot committed Oct 22, 2024
1 parent aebdee8 commit 1c92a41
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions infer/tests/codetoanalyze/erlang/compiler/issues.exp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ features_arithmetic:test_uminus1_Ok/0: ok
features_arithmetic:test_uminus2_Bad/0: expected_crash
features_arithmetic:test_uminus2_Ok/0: ok

----- features_binary_attr -----
features_binary_attr:test_bad_Bad/0: expected_crash
features_binary_attr:test_ok_Ok/0: ok

----- features_bitwise -----
features_bitwise:test_band1_Bad/0: expected_crash
features_bitwise:test_band1_Ok/0: ok
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
% Copyright (c) Facebook, Inc. and its affiliates.
%
% This source code is licensed under the MIT license found in the
% LICENSE file in the root directory of this source tree.

-module(features_binary_attr).
-some_attribute(<<"which has binary inside">>).
-export([
test_ok_Ok/0,
test_bad_Bad/0
]).
-include("../../common.hrl").

test_ok_Ok() -> ok.

test_bad_Bad() -> ?EXPECTED_CRASH().
1 change: 1 addition & 0 deletions infer/tests/codetoanalyze/erlang/pulse/issues.exp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ codetoanalyze/erlang/pulse/features/features_arithmetic.erl, test_multiple_Bad/0
codetoanalyze/erlang/pulse/features/features_arithmetic.erl, test_uminus1_Bad/0, 2, NO_MATCH_OF_RHS, no_bucket, ERROR, [no match of RHS here]
codetoanalyze/erlang/pulse/features/features_arithmetic.erl, test_uminus2_Bad/0, 2, NO_MATCH_OF_RHS, no_bucket, ERROR, [no match of RHS here]
codetoanalyze/erlang/pulse/features/features_arithmetic.erl, test_big_Bad/0, 14, NO_MATCH_OF_RHS, no_bucket, ERROR, [no match of RHS here]
codetoanalyze/erlang/pulse/features/features_binary_attr.erl, test_bad_Bad/0, 0, NO_MATCH_OF_RHS, no_bucket, ERROR, [no match of RHS here]
codetoanalyze/erlang/pulse/features/features_bitwise.erl, test_band1_Bad/0, 3, NO_MATCH_OF_RHS, no_bucket, ERROR, [no match of RHS here]
codetoanalyze/erlang/pulse/features/features_bitwise.erl, test_band2_Bad/0, 3, NO_MATCH_OF_RHS, no_bucket, ERROR, [no match of RHS here]
codetoanalyze/erlang/pulse/features/features_bitwise.erl, test_bor1_Bad/0, 3, NO_MATCH_OF_RHS, no_bucket, ERROR, [no match of RHS here]
Expand Down

0 comments on commit 1c92a41

Please sign in to comment.