Skip to content

Commit de60815

Browse files
committed
make test code warning free
1 parent 288b946 commit de60815

17 files changed

+21
-20
lines changed

jscomp/test/ast_mapper_unused_warning_test.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
[@@@warning "-104"]
23

34

45
type t =

jscomp/test/bs_float_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let () =
3737
eq __LOC__ (F.toString (-1.5)) "-1.5"
3838

3939
let () =
40-
let open F in
40+
let open! F in
4141
eq __LOC__ (2.0 + 3.0) 5.0;
4242
eq __LOC__ (2.0 - 3.0) (-1.0);
4343
eq __LOC__ (2.0 * 3.0) 6.0;

jscomp/test/bs_hashtbl_string_test.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module Md = Belt.Map
8686
module Md0 = Belt.Map.Dict
8787
let bench3 (type t) (m : (string,t) Belt.Id.comparable) =
8888

89-
let empty = Md.make m in
89+
let empty = Md.make ~id:m in
9090
let module String = (val m) in
9191
let cmp = String.cmp in
9292
let table = ref (Md.getData empty) in
@@ -108,7 +108,7 @@ module Sx = (val Belt.Id.comparable ~cmp:(fun (x : string) y -> compare x y ))
108108
module H = Belt.HashMap.String
109109
let bench4 () =
110110
let table =
111-
H.make initial_size in
111+
H.make ~hintSize:initial_size in
112112

113113
for i = 0 to count do
114114
H.set
@@ -146,7 +146,7 @@ let bench5 () =
146146
module HI = Belt.HashMap.Int
147147
let bench6 () =
148148
let table =
149-
HI.make initial_size in
149+
HI.make ~hintSize:initial_size in
150150

151151
for i = 0 to count do
152152
HI.set
@@ -165,7 +165,7 @@ module S = Belt.HashSet.Int
165165
let bench7 () =
166166
let table =
167167
(* [%time *)
168-
S.make (initial_size* 2)
168+
S.make ~hintSize:(initial_size* 2)
169169
(* ] *)
170170
in
171171

jscomp/test/bs_int_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let () =
3636
eq __LOC__ (I.toString (-1)) "-1"
3737

3838
let () =
39-
let open I in
39+
let open! I in
4040
eq __LOC__ (2 + 3) 5;
4141
eq __LOC__ (2 - 3) (-1);
4242
eq __LOC__ (2 * 3) 6;

jscomp/test/bs_set_int_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let suites : Mt.pair_suites ref = ref []
1+
[@@@warning "-44"] let suites : Mt.pair_suites ref = ref []
22
let test_id = ref 0
33
let eq loc x y = Mt.eq_suites ~suites ~test_id loc x y
44

jscomp/test/build.ninja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
bsc = ../lib/bsc.exe
3-
bsc_flags = -absname -bs-no-version-header -bs-diagnose -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:jscomp/test -w -40-52 -bin-annot -I runtime -I $stdlib -I others
3+
bsc_flags = -absname -bs-no-version-header -bs-diagnose -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:jscomp/test -w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104 -warn-error A -I runtime -I $stdlib -I others
44

55
rule cc
66
command = $bsc -bs-cmi -bs-cmj $bsc_flags -I test $in

jscomp/test/caml_compare_test.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
1+
[@@@warning "-45"]
22
type u = A of int | B of int * bool | C of int
33

44
let function_equal_test = try ((fun x -> x + 1) = (fun x -> x + 2)) with
55
| Invalid_argument "equal: functional value" -> true
66
| _ -> false
7-
7+
88
let suites = ref Mt.[
99
__LOC__ , (fun _ -> Eq(true, None < Some 1));
1010
"option2", (fun _ -> Eq(true, Some 1 < Some 2));

jscomp/test/caml_format_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
[@@@warning "-107"]
22
let of_string =
33
[| (0, "0"); (3, "03"); (-3, "-03"); (-63, "-0x3f"); (-31, "-0x1f");
44
(47, "0X2f"); (11, "0O13"); (8, "0o10"); (3, "0b11"); (1, "0b01");

jscomp/test/class3_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ let () = eq __LOC__ hhh 35
181181
class point_again3 x =
182182
object
183183
inherit restricted_point x as super
184-
method move = super#move
184+
method! move = super#move
185185
end;;
186186

187187

jscomp/test/class5_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class printable_colored_point y c =
1919
val c = c
2020
method color = c
2121
inherit printable_point y as super
22-
method print =
22+
method! print =
2323
"(" ^
2424
super#print ^
2525
", " ^

0 commit comments

Comments
 (0)