-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Adding tests to check topl properties from specs when specs are remote Reviewed By: hajduakos Differential Revision: D49454557 fbshipit-source-id: 31169dae523cb38bca5a585bbf6d250284fbcfdc
- Loading branch information
1 parent
a625992
commit a66dbfa
Showing
5 changed files
with
46 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
specs.erl, test_arg1_Bad/1, 0, TOPL_ERROR, no_bucket, ERROR, [call to __infer_assume_type_dirty/1,call to sink/1] | ||
specs.erl, test_ret1_Bad/0, 0, TOPL_ERROR, no_bucket, ERROR, [call to source/0,call to __infer_assume_type_dirty/1,call to sink/1] | ||
specs.erl, test_ret2_Bad/0, 0, TOPL_ERROR, no_bucket, ERROR, [call to source/0,call to __infer_assume_type_dirty/1,call to sinksink/1,call to sink/1] | ||
codetoanalyze/erlang/topl/specs/remote_specs.erl, test_arg1_Bad/1, 0, TOPL_ERROR_LATENT, no_bucket, ERROR, [call to __infer_assume_type_dirty/1,call to sink/1] | ||
codetoanalyze/erlang/topl/specs/remote_specs.erl, test_ret1_Bad/0, 0, TOPL_ERROR, no_bucket, ERROR, [call to source/0,call to __infer_assume_type_dirty/1,call to sink/1] | ||
codetoanalyze/erlang/topl/specs/remote_specs.erl, test_ret2_Bad/0, 0, TOPL_ERROR, no_bucket, ERROR, [call to source/0,call to source/0,call to __infer_assume_type_dirty/1,call to sink/1] | ||
codetoanalyze/erlang/topl/specs/specs.erl, test_arg1_Bad/1, 0, TOPL_ERROR_LATENT, no_bucket, ERROR, [call to __infer_assume_type_dirty/1,call to sink/1] | ||
codetoanalyze/erlang/topl/specs/specs.erl, test_ret1_Bad/0, 0, TOPL_ERROR, no_bucket, ERROR, [call to source/0,call to __infer_assume_type_dirty/1,call to sink/1] | ||
codetoanalyze/erlang/topl/specs/specs.erl, test_ret2_Bad/0, 0, TOPL_ERROR, no_bucket, ERROR, [call to source/0,call to __infer_assume_type_dirty/1,call to sinksink/1,call to sink/1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
property SourceIsSpec | ||
start -> start: * | ||
start -> track: ".*:__infer_assume_type_dirty/1"(Arg, Ret) when Ret != 0 => dirty := Arg | ||
start -> track: "specs:__infer_assume_type_dirty/1"(Arg, Ret) when Ret != 0 => dirty := Arg | ||
track -> error: ".*:sink/1"(Arg, Ret) when Arg == dirty |
33 changes: 33 additions & 0 deletions
33
infer/tests/codetoanalyze/erlang/topl/specs/remote_specs.erl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
% 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(remote_specs). | ||
-export([ | ||
test_arg1_Bad/1, | ||
test_arg2_Ok/1, | ||
test_ret1_Bad/0, | ||
test_ret2_Bad/0 | ||
]). | ||
|
||
-type dirty() :: atom(). | ||
|
||
-spec test_arg1_Bad(specs:dirty()) -> any(). | ||
test_arg1_Bad(X) -> | ||
sink(X). | ||
|
||
-spec test_arg2_Ok(dirty()) -> any(). | ||
test_arg2_Ok(X) -> | ||
sink(X). | ||
|
||
test_ret1_Bad() -> | ||
sink(specs:source()). | ||
|
||
test_ret2_Bad() -> | ||
sink(source()). | ||
|
||
-spec source() -> specs:dirty(). | ||
source() -> | ||
specs:source(). | ||
|
||
sink(_) -> ok. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters