@@ -8126,7 +8126,7 @@ let suites =
8126
8126
ok (v_output.exit_code = 0) v_output
8127
8127
end;
8128
8128
__LOC__ >:: begin fun _ ->
8129
- let v_output = perform_bsc [|"-bs-eval"; {|type 'a arra = 'a array
8129
+ let v_output = perform_bsc [|"-bs-eval"; {|type 'a arra = 'a array
8130
8130
external
8131
8131
f :
8132
8132
int -> int -> int arra -> unit
@@ -8135,8 +8135,8 @@ let suites =
8135
8135
[@@bs.splice]|}|] in
8136
8136
OUnit.assert_bool __LOC__ (Ext_string.contain_substring v_output.stderr "variadic")
8137
8137
end;
8138
- __LOC__ >:: begin fun _ ->
8139
- let v_output = perform_bsc [|"-bs-eval"; {|external
8138
+ __LOC__ >:: begin fun _ ->
8139
+ let v_output = perform_bsc [|"-bs-eval"; {|external
8140
8140
f2 :
8141
8141
int -> int -> ?y:int array -> unit
8142
8142
= ""
@@ -8152,13 +8152,13 @@ let suites =
8152
8152
OUnit.assert_bool __LOC__ (Ext_string.contain_substring
8153
8153
should_be_warning.stderr "Unused")
8154
8154
end;
8155
- __LOC__ >:: begin fun _ ->
8155
+ __LOC__ >:: begin fun _ ->
8156
8156
let should_be_warning =
8157
8157
bsc_check_eval {| external mk : int -> ([`a|`b [@bs.string]]) = "mk" [@@bs.val] |} in
8158
- OUnit.assert_bool __LOC__
8158
+ OUnit.assert_bool __LOC__
8159
8159
(Ext_string.contain_substring
8160
- should_be_warning.stderr "Unused")
8161
- end;
8160
+ should_be_warning.stderr "Unused")
8161
+ end;
8162
8162
__LOC__ >:: begin fun _ ->
8163
8163
let should_err = bsc_check_eval {|
8164
8164
external ff :
@@ -8261,12 +8261,12 @@ external ff :
8261
8261
end;
8262
8262
8263
8263
(* __LOC__ >:: begin fun _ ->
8264
- let should_err = bsc_check_eval {|
8265
- external f : string -> unit -> unit = "x.y" [@@bs.send]
8266
- |} in
8267
- OUnit.assert_bool __LOC__
8264
+ let should_err = bsc_check_eval {|
8265
+ external f : string -> unit -> unit = "x.y" [@@bs.send]
8266
+ |} in
8267
+ OUnit.assert_bool __LOC__
8268
8268
(Ext_string.contain_substring should_err.stderr "Not a valid method name")
8269
- end; *)
8269
+ end; *)
8270
8270
8271
8271
8272
8272
__LOC__ >:: begin fun _ ->
@@ -8276,7 +8276,7 @@ type t10 = A of t10 [@@ocaml.unboxed];;
8276
8276
let rec x = A x;;
8277
8277
|} in
8278
8278
OUnit.assert_bool __LOC__
8279
- (Ext_string.contain_substring should_err.stderr "This kind of expression is not allowed")
8279
+ (Ext_string.contain_substring should_err.stderr "This kind of expression is not allowed")
8280
8280
end;
8281
8281
8282
8282
__LOC__ >:: begin fun _ ->
@@ -8285,15 +8285,15 @@ let rec x = A x;;
8285
8285
let rec x = {x = y} and y = 3L;;
8286
8286
|} in
8287
8287
OUnit.assert_bool __LOC__
8288
- (Ext_string.contain_substring should_err.stderr "This kind of expression is not allowed")
8288
+ (Ext_string.contain_substring should_err.stderr "This kind of expression is not allowed")
8289
8289
end;
8290
8290
__LOC__ >:: begin fun _ ->
8291
8291
let should_err = bsc_check_eval {|
8292
8292
type r = A of r [@@unboxed];;
8293
8293
let rec y = A y;;
8294
8294
|} in
8295
8295
OUnit.assert_bool __LOC__
8296
- (Ext_string.contain_substring should_err.stderr "This kind of expression is not allowed")
8296
+ (Ext_string.contain_substring should_err.stderr "This kind of expression is not allowed")
8297
8297
end;
8298
8298
8299
8299
__LOC__ >:: begin fun _ ->
@@ -8336,60 +8336,71 @@ let rec y = A y;;
8336
8336
8337
8337
end;
8338
8338
__LOC__ >:: begin fun _ ->
8339
- let should_err = bsc_check_eval {|
8339
+ let should_err = bsc_check_eval {|
8340
8340
external foo_bar :
8341
8341
(_ [@bs.as "foo"]) ->
8342
8342
string ->
8343
8343
string = "bar"
8344
8344
[@@bs.send]
8345
8345
|} in
8346
- OUnit.assert_bool __LOC__
8347
- (Ext_string.contain_substring should_err.stderr "Ill defined attribute")
8348
- end;
8346
+ OUnit.assert_bool __LOC__
8347
+ (Ext_string.contain_substring should_err.stderr "Ill defined attribute")
8348
+ end;
8349
8349
__LOC__ >:: begin fun _ ->
8350
- let should_err = bsc_check_eval {|
8350
+ let should_err = bsc_check_eval {|
8351
8351
let bla4 foo x y = foo##(method1 x y [@bs])
8352
8352
|} in
8353
- (* Ounit_cmd_util.debug_output should_err ; *)
8354
- OUnit.assert_bool __LOC__
8355
- (Ext_string.contain_substring should_err.stderr
8356
- "Unused")
8357
- end;
8353
+ (* Ounit_cmd_util.debug_output should_err ; *)
8354
+ OUnit.assert_bool __LOC__
8355
+ (Ext_string.contain_substring should_err.stderr
8356
+ "Unused")
8357
+ end;
8358
8358
__LOC__ >:: begin fun _ ->
8359
- let should_err = bsc_check_eval {|
8359
+ let should_err = bsc_check_eval {|
8360
8360
external mk : int ->
8361
8361
(
8362
8362
[`a|`b]
8363
8363
[@bs.string]
8364
8364
) = "mk" [@@bs.val]
8365
8365
|} in
8366
- (* Ounit_cmd_util.debug_output should_err ; *)
8367
- OUnit.assert_bool __LOC__
8368
- (Ext_string.contain_substring should_err.stderr
8369
- "Unused")
8370
- end;
8371
- __LOC__ >:: begin fun _ ->
8372
- let should_err = bsc_check_eval {|
8366
+ (* Ounit_cmd_util.debug_output should_err ; *)
8367
+ OUnit.assert_bool __LOC__
8368
+ (Ext_string.contain_substring should_err.stderr
8369
+ "Unused")
8370
+ end;
8371
+ __LOC__ >:: begin fun _ ->
8372
+ let should_err = bsc_check_eval {|
8373
8373
type -'a t = {k : 'a } [@@bs.deriving abstract]
8374
8374
|} in
8375
- OUnit.assert_bool __LOC__
8376
- (Ext_string.contain_substring should_err.stderr "contravariant")
8377
- end;
8378
- __LOC__ >:: begin fun _ ->
8379
- let should_err = bsc_check_eval {|
8375
+ OUnit.assert_bool __LOC__
8376
+ (Ext_string.contain_substring should_err.stderr "contravariant")
8377
+ end;
8378
+ __LOC__ >:: begin fun _ ->
8379
+ let should_err = bsc_check_eval {|
8380
8380
let u = [||]
8381
8381
|} in
8382
- OUnit.assert_bool __LOC__
8383
- (Ext_string.contain_substring should_err.stderr "cannot be generalized")
8384
- end
8382
+ OUnit.assert_bool __LOC__
8383
+ (Ext_string.contain_substring should_err.stderr "cannot be generalized")
8384
+ end;
8385
+ __LOC__ >:: begin fun _ ->
8386
+ let should_err = bsc_check_eval {|
8387
+ external push : 'a array -> 'a -> unit = "push" [@@send]
8388
+ let a = [||]
8389
+ let () =
8390
+ push a 3 |. ignore ;
8391
+ push a "3" |. ignore
8392
+ |} in
8393
+ OUnit.assert_bool __LOC__
8394
+ (Ext_string.contain_substring should_err.stderr "has type string")
8395
+ end
8385
8396
(* __LOC__ >:: begin fun _ -> *)
8386
8397
(* let should_infer = perform_bsc [| "-i"; "-bs-eval"|] {| *)
8387
- (* let f = fun [@bs] x -> let (a,b) = x in a + b *)
8388
- (* |} in *)
8398
+ (* let f = fun [@bs] x -> let (a,b) = x in a + b *)
8399
+ (* |} in *)
8389
8400
(* let infer_type = bsc_eval (Printf.sprintf {| *)
8390
8401
8391
- (* let f : %s = fun [@bs] x -> let (a,b) = x in a + b *)
8392
- (* |} should_infer.stdout ) in *)
8402
+ (* let f : %s = fun [@bs] x -> let (a,b) = x in a + b *)
8403
+ (* |} should_infer.stdout ) in *)
8393
8404
(* begin *)
8394
8405
(* Ounit_cmd_util.debug_output should_infer ; *)
8395
8406
(* Ounit_cmd_util.debug_output infer_type ; *)
0 commit comments