"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "analysis/test/integration/coverageTest.ml" between
pyre-check-0.0.54.tar.gz and pyre-check-0.0.55.tar.gz

About: Pyre is a performant type checker for Python (ships with Pysa, a security focused static analysis tool).

coverageTest.ml  (pyre-check-0.0.54):coverageTest.ml  (pyre-check-0.0.55)
skipping to change at line 27 skipping to change at line 27
|> String.split ~on:'\n' |> String.split ~on:'\n'
|> List.map ~f:(fun line -> " " ^ line) |> List.map ~f:(fun line -> " " ^ line)
|> String.concat ~sep:"\n" |> String.concat ~sep:"\n"
|> String.substr_replace_all ~pattern:"ERROR" ~with_:"a.undefined" |> String.substr_replace_all ~pattern:"ERROR" ~with_:"a.undefined"
|> Format.asprintf "from builtins import A\nimport typing\ndef foo(a: A) -> None:\n%s\n" |> Format.asprintf "from builtins import A\nimport typing\ndef foo(a: A) -> None:\n%s\n"
in in
let assert_covered ?(additional_errors = []) source = let assert_covered ?(additional_errors = []) source =
let undefined_attribute_errors = let undefined_attribute_errors =
["Undefined attribute [16]: `A` has no attribute `undefined`."] ["Undefined attribute [16]: `A` has no attribute `undefined`."]
in in
assert_type_errors ~context (preprocess source) (additional_errors @ undefin assert_type_errors
ed_attribute_errors) ~context
(preprocess source)
(additional_errors @ undefined_attribute_errors |> List.sort ~compare:Stri
ng.compare)
in in
(* Return statement. *) (* Return statement. *)
assert_covered assert_covered
~additional_errors:["Incompatible return type [7]: Expected `None` but got ` unknown`."] ~additional_errors:["Incompatible return type [7]: Expected `None` but got ` unknown`."]
"return ERROR"; "return ERROR";
(* Assignment. *) (* Assignment. *)
assert_covered "b = ERROR"; assert_covered "b = ERROR";
skipping to change at line 102 skipping to change at line 105
(* Await. *) (* Await. *)
assert_covered assert_covered
~additional_errors: ~additional_errors:
["Incompatible awaitable type [12]: Expected an awaitable but got `unknown `."] ["Incompatible awaitable type [12]: Expected an awaitable but got `unknown `."]
"await ERROR"; "await ERROR";
(* Binary operator. *) (* Binary operator. *)
assert_covered assert_covered
~additional_errors: ~additional_errors:
[ ["Unsupported operand [58]: `|` is not supported for operand types `unknow
"Incompatible parameter type [6]: `|` is not supported for operand types n` and `int`."]
`unknown` and \
`int`.";
]
"ERROR | 1"; "ERROR | 1";
assert_covered assert_covered
~additional_errors: ~additional_errors:
[ ["Unsupported operand [58]: `%` is not supported for operand types `int` a
"Incompatible parameter type [6]: `%` is not supported for operand types nd `unknown`."]
`int` and \
`unknown`.";
]
"1 % ERROR"; "1 % ERROR";
(* Boolean operator. *) (* Boolean operator. *)
assert_covered "ERROR or False"; assert_covered "ERROR or False";
assert_covered "True or ERROR"; assert_covered "True or ERROR";
assert_covered "ERROR and False"; assert_covered "ERROR and False";
assert_covered "True and ERROR"; assert_covered "True and ERROR";
(* Comparison operator. *) (* Comparison operator. *)
assert_covered "1 == ERROR"; assert_covered "1 == ERROR";
assert_covered assert_covered
~additional_errors: ~additional_errors:
[ ["Unsupported operand [58]: `<` is not supported for operand types `unknow
"Incompatible parameter type [6]: `<` is not supported for operand types n` and `int`."]
`unknown` and \
`int`.";
]
"ERROR < 1"; "ERROR < 1";
(* Dictionaries. *) (* Dictionaries. *)
assert_covered "{ ERROR: 1 }"; assert_covered "{ ERROR: 1 }";
assert_covered "{ 1: ERROR }"; assert_covered "{ 1: ERROR }";
assert_covered "{ ERROR: i for i in {1: 1} }"; assert_covered "{ ERROR: i for i in {1: 1} }";
assert_covered "{ i: ERROR for i in {1: 1} }"; assert_covered "{ i: ERROR for i in {1: 1} }";
assert_covered "{ i: 1 for i in ERROR }"; assert_covered "{ i: 1 for i in ERROR }";
(* Format string. *) (* Format string. *)
 End of changes. 4 change blocks. 
17 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)