2 * Copyright (c) 2016, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
11 open Integration_test_base_types
14 module Test
= Integration_test_base
16 let foo_contents = "<?hh
22 let env = Test.setup_server
() in
23 let (env, loop_output
) =
27 { default_loop_input
with disk_changes
= [("foo.php", foo_contents)] })
29 if not loop_output
.did_read_disk_changes
then
30 Test.fail
"Expected the server to process disk updates";
33 "File \"/foo.php\", line 3, characters 1-1:\n"
34 ^
"Toplevel statements are not allowed. Use `__EntryPoint` attribute instead (Parsing[1002])";
35 "File \"/foo.php\", line 3, characters 2-2:\n"
36 ^
"A right brace `}` is expected here. (Parsing[1002])\n";
39 match List.zip
expected_errors (Errors.get_error_list
env.errorl
) with
40 | List.Or_unequal_lengths.Ok errs
->
42 ~f
:(fun (expected
, err
) -> Test.assertSingleError expected
[err
])
44 | List.Or_unequal_lengths.Unequal_lengths
-> Test.fail
"Expected 2 errors."