Skip to content

Commit 234bc0f

Browse files
authored
Merge pull request #2674 from BuckleScript/fix_2672
fix #2672
2 parents a1e53a0 + 9a56ab4 commit 234bc0f

File tree

13 files changed

+171
-166
lines changed

13 files changed

+171
-166
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ env:
88
- BS_TRAVIS_CI=1
99
node_js:
1010
- 6
11-
script: npm run coveralls
11+
12+
# script: npm run coveralls
13+
# if we turn on this script, we should make
14+
# sure `npm test` is executed
1215
#
1316
# - 6
1417
# This delays notification
1518

16-
# Not a very reliable service..
19+
# Not a very reliable service..
1720

1821
# FIXME: instrumentation takes too much time
1922

jscomp/bin/all_ounit_tests.ml

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3913,153 +3913,153 @@ let (=~) = OUnit.assert_equal
39133913

39143914

39153915
(* let output_of_exec_command command args =
3916-
let readme, writeme = Unix.pipe () in
3917-
let pid = Unix.create_process command args Unix.stdin writeme Unix.stderr in
3916+
let readme, writeme = Unix.pipe () in
3917+
let pid = Unix.create_process command args Unix.stdin writeme Unix.stderr in
39183918
let in_chan = Unix.in_channel_of_descr readme *)
39193919

39203920

39213921

39223922
let perform_bsc = Ounit_cmd_util.perform_bsc
3923-
let bsc_check_eval = Ounit_cmd_util.bsc_check_eval
3923+
let bsc_check_eval = Ounit_cmd_util.bsc_check_eval
39243924

39253925

3926-
let suites =
3926+
let suites =
39273927
__FILE__
39283928
>::: [
3929-
__LOC__ >:: begin fun _ ->
3930-
let v_output = perform_bsc [| "-v" |] in
3929+
__LOC__ >:: begin fun _ ->
3930+
let v_output = perform_bsc [| "-v" |] in
39313931
OUnit.assert_bool __LOC__ ((perform_bsc [| "-h" |]).exit_code <> 0 );
39323932
OUnit.assert_bool __LOC__ (v_output.exit_code = 0);
39333933
(* Printf.printf "\n*>%s" v_output.stdout; *)
39343934
(* Printf.printf "\n*>%s" v_output.stderr ; *)
3935-
end;
3936-
__LOC__ >:: begin fun _ ->
3937-
let v_output =
3938-
perform_bsc [| "-bs-eval"; {|let str = "'a'" |}|] in
3935+
end;
3936+
__LOC__ >:: begin fun _ ->
3937+
let v_output =
3938+
perform_bsc [| "-bs-eval"; {|let str = "'a'" |}|] in
39393939
OUnit.assert_bool __LOC__ (v_output.exit_code = 0)
39403940
end;
3941-
__LOC__ >:: begin fun _ ->
3942-
let should_be_warning =
3943-
bsc_check_eval {|let bla4 foo x y= foo##(method1 x y [@bs]) |} in
3941+
__LOC__ >:: begin fun _ ->
3942+
let should_be_warning =
3943+
bsc_check_eval {|let bla4 foo x y= foo##(method1 x y [@bs]) |} in
39443944
(* debug_output should_be_warning; *)
39453945
OUnit.assert_bool __LOC__ (Ext_string.contain_substring
39463946
should_be_warning.stderr "Unused")
39473947
end;
3948-
__LOC__ >:: begin fun _ ->
3949-
let should_be_warning =
3950-
bsc_check_eval {| external mk : int -> ([`a|`b [@bs.string]]) = "" [@@bs.val] |} in
3951-
OUnit.assert_bool __LOC__
3948+
__LOC__ >:: begin fun _ ->
3949+
let should_be_warning =
3950+
bsc_check_eval {| external mk : int -> ([`a|`b [@bs.string]]) = "" [@@bs.val] |} in
3951+
OUnit.assert_bool __LOC__
39523952
(Ext_string.contain_substring
39533953
should_be_warning.stderr "Unused")
39543954
end;
3955-
__LOC__ >:: begin fun _ ->
3955+
__LOC__ >:: begin fun _ ->
39563956
let should_err = bsc_check_eval {|
3957-
external ff :
3958-
resp -> (_ [@bs.as "x"]) -> int -> unit =
3959-
"x" [@@bs.set]
3960-
|} in
3961-
OUnit.assert_bool __LOC__
3957+
external ff :
3958+
resp -> (_ [@bs.as "x"]) -> int -> unit =
3959+
"x" [@@bs.set]
3960+
|} in
3961+
OUnit.assert_bool __LOC__
39623962
(Ext_string.contain_substring should_err.stderr
39633963
"Ill defined"
39643964
)
39653965
end;
39663966

3967-
__LOC__ >:: begin fun _ ->
3968-
(** used in return value
3969-
This should fail, we did not
3967+
__LOC__ >:: begin fun _ ->
3968+
(** used in return value
3969+
This should fail, we did not
39703970
support uncurry return value yet
39713971
*)
39723972
let should_err = bsc_check_eval {|
39733973
external v3 :
39743974
int -> int -> (int -> int -> int [@bs.uncurry])
39753975
= ""[@@bs.val]
39763976

3977-
|} in
3977+
|} in
39783978
(* Ounit_cmd_util.debug_output should_err;*)
39793979
OUnit.assert_bool __LOC__
3980-
(Ext_string.contain_substring
3980+
(Ext_string.contain_substring
39813981
should_err.stderr "bs.uncurry")
39823982
end ;
39833983

3984-
__LOC__ >:: begin fun _ ->
3984+
__LOC__ >:: begin fun _ ->
39853985
let should_err = bsc_check_eval {|
3986-
external v4 :
3986+
external v4 :
39873987
(int -> int -> int [@bs.uncurry]) = ""
39883988
[@@bs.val]
39893989

3990-
|} in
3990+
|} in
39913991
(* Ounit_cmd_util.debug_output should_err ; *)
39923992
OUnit.assert_bool __LOC__
3993-
(Ext_string.contain_substring
3993+
(Ext_string.contain_substring
39943994
should_err.stderr "bs.uncurry")
39953995
end ;
39963996

3997-
__LOC__ >:: begin fun _ ->
3997+
__LOC__ >:: begin fun _ ->
39983998
let should_err = bsc_check_eval {|
39993999
{js| \uFFF|js}
4000-
|} in
4000+
|} in
40014001
OUnit.assert_bool __LOC__ (not @@ Ext_string.is_empty should_err.stderr)
40024002
end;
40034003

4004-
__LOC__ >:: begin fun _ ->
4004+
__LOC__ >:: begin fun _ ->
40054005
let should_err = bsc_check_eval {|
40064006
external mk : int -> ([`a|`b] [@bs.string]) = "" [@@bs.val]
4007-
|} in
4007+
|} in
40084008
OUnit.assert_bool __LOC__ (not @@ Ext_string.is_empty should_err.stderr)
40094009
end;
40104010

4011-
__LOC__ >:: begin fun _ ->
4011+
__LOC__ >:: begin fun _ ->
40124012
let should_err = bsc_check_eval {|
40134013
external mk : int -> ([`a|`b] ) = "" [@@bs.val]
4014-
|} in
4014+
|} in
40154015
OUnit.assert_bool __LOC__ ( Ext_string.is_empty should_err.stderr)
4016-
(* give a warning or ?
4017-
( [`a | `b ] [@bs.string] )
4016+
(* give a warning or ?
4017+
( [`a | `b ] [@bs.string] )
40184018
(* auto-convert to ocaml poly-variant *)
40194019
*)
40204020
end;
40214021

4022-
__LOC__ >:: begin fun _ ->
4022+
__LOC__ >:: begin fun _ ->
40234023
let should_err = bsc_check_eval {|
4024-
type t
4024+
type t
40254025
external mk : int -> (_ [@bs.as {json| { x : 3 } |json}]) -> t = "" [@@bs.val]
4026-
|} in
4026+
|} in
40274027
OUnit.assert_bool __LOC__ (Ext_string.contain_substring should_err.stderr "Invalid json literal")
40284028
end
40294029
;
4030-
__LOC__ >:: begin fun _ ->
4030+
__LOC__ >:: begin fun _ ->
40314031
let should_err = bsc_check_eval {|
4032-
type t
4032+
type t
40334033
external mk : int -> (_ [@bs.as {json| { "x" : 3 } |json}]) -> t = "" [@@bs.val]
4034-
|} in
4034+
|} in
40354035
OUnit.assert_bool __LOC__ (Ext_string.is_empty should_err.stderr)
40364036
end
40374037
;
40384038
(* #1510 *)
4039-
__LOC__ >:: begin fun _ ->
4039+
__LOC__ >:: begin fun _ ->
40404040
let should_err = bsc_check_eval {|
4041-
let should_fail = fun [@bs.this] (Some x) y u -> y + u
4042-
|} in
4043-
OUnit.assert_bool __LOC__
4041+
let should_fail = fun [@bs.this] (Some x) y u -> y + u
4042+
|} in
4043+
OUnit.assert_bool __LOC__
40444044
(Ext_string.contain_substring should_err.stderr "simple")
40454045
end;
40464046

4047-
__LOC__ >:: begin fun _ ->
4047+
__LOC__ >:: begin fun _ ->
40484048
let should_err = bsc_check_eval {|
4049-
let should_fail = fun [@bs.this] (Some x as v) y u -> y + u
4050-
|} in
4049+
let should_fail = fun [@bs.this] (Some x as v) y u -> y + u
4050+
|} in
40514051
(* Ounit_cmd_util.debug_output should_err; *)
4052-
OUnit.assert_bool __LOC__
4052+
OUnit.assert_bool __LOC__
40534053
(Ext_string.contain_substring should_err.stderr "simple")
40544054
end;
40554055

4056-
__LOC__ >:: begin fun _ ->
4056+
(* __LOC__ >:: begin fun _ ->
40574057
let should_err = bsc_check_eval {|
40584058
external f : string -> unit -> unit = "x.y" [@@bs.send]
4059-
|} in
4060-
OUnit.assert_bool __LOC__
4059+
|} in
4060+
OUnit.assert_bool __LOC__
40614061
(Ext_string.contain_substring should_err.stderr "Not a valid method name")
4062-
end;
4062+
end; *)
40634063

40644064

40654065

@@ -4103,50 +4103,50 @@ external ff :
41034103
(not (Ext_string.is_empty should_err.stderr))
41044104

41054105
end;
4106-
__LOC__ >:: begin fun _ ->
4106+
__LOC__ >:: begin fun _ ->
41074107
let should_err = bsc_check_eval {|
41084108
external foo_bar :
41094109
(_ [@bs.as "foo"]) ->
41104110
string ->
41114111
string = "bar"
41124112
[@@bs.send]
4113-
|} in
4114-
OUnit.assert_bool __LOC__
4113+
|} in
4114+
OUnit.assert_bool __LOC__
41154115
(Ext_string.contain_substring should_err.stderr "Ill defined attribute")
41164116
end;
4117-
__LOC__ >:: begin fun _ ->
4117+
__LOC__ >:: begin fun _ ->
41184118
let should_err = bsc_check_eval {|
41194119
let bla4 foo x y = foo##(method1 x y [@bs])
4120-
|} in
4120+
|} in
41214121
(* Ounit_cmd_util.debug_output should_err ; *)
4122-
OUnit.assert_bool __LOC__
4122+
OUnit.assert_bool __LOC__
41234123
(Ext_string.contain_substring should_err.stderr
41244124
"Unused")
41254125
end;
4126-
__LOC__ >:: begin fun _ ->
4126+
__LOC__ >:: begin fun _ ->
41274127
let should_err = bsc_check_eval {|
4128-
external mk : int ->
4128+
external mk : int ->
41294129
(
4130-
[`a|`b]
4131-
[@bs.string]
4132-
) = "" [@@bs.val]
4133-
|} in
4130+
[`a|`b]
4131+
[@bs.string]
4132+
) = "" [@@bs.val]
4133+
|} in
41344134
(* Ounit_cmd_util.debug_output should_err ; *)
4135-
OUnit.assert_bool __LOC__
4135+
OUnit.assert_bool __LOC__
41364136
(Ext_string.contain_substring should_err.stderr
41374137
"Unused")
41384138
end;
4139-
__LOC__ >:: begin fun _ ->
4139+
__LOC__ >:: begin fun _ ->
41404140
let should_err = bsc_check_eval {|
41414141
type -'a t = {k : 'a } [@@bs.deriving abstract]
4142-
|} in
4142+
|} in
41434143
OUnit.assert_bool __LOC__
41444144
(Ext_string.contain_substring should_err.stderr "contravariant")
41454145
end;
4146-
__LOC__ >:: begin fun _ ->
4146+
__LOC__ >:: begin fun _ ->
41474147
let should_err = bsc_check_eval {|
41484148
type 'a t = {k : int -> 'a } [@@bs.deriving abstract]
4149-
|} in
4149+
|} in
41504150
OUnit.assert_bool __LOC__
41514151
(Ext_string.contain_substring should_err.stderr "not allowed")
41524152
end

jscomp/build_tests/ns/src/demo.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/ns/src/hello.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/priv/node_modules/liba/.merlin

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/priv/src/demo.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/priv/src/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/priv2/node_modules/liba/.merlin

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/priv2/node_modules/liba/src/demo.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/priv2/node_modules/liba/src/priv.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)