Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion jscomp/bin/all_ounit_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13914,6 +13914,7 @@ let namespace_of_package_name (s : string) : string =
->
add capital ch ;
aux false (off + 1) len
| '/'
| '-' ->
aux true (off + 1) len
| _ -> aux capital (off+1) len
Expand Down Expand Up @@ -14239,12 +14240,19 @@ let suites =
=~ "BsJson"
end;
__LOC__ >:: begin fun _ ->
let (=~) = OUnit.assert_equal ~printer:(fun x -> x) in
Ext_namespace.namespace_of_package_name
"reason-react"
=~ "ReasonReact";
Ext_namespace.namespace_of_package_name
"reason"
=~ "Reason"
=~ "Reason";
Ext_namespace.namespace_of_package_name
"@aa/bb"
=~"AaBb";
Ext_namespace.namespace_of_package_name
"@A/bb"
=~"ABb"
end;
__LOC__ >:: begin fun _ ->
Ext_namespace.js_name_of_basename false "a-b"
Expand Down
1 change: 1 addition & 0 deletions jscomp/ext/ext_namespace.ml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ let namespace_of_package_name (s : string) : string =
->
add capital ch ;
aux false (off + 1) len
| '/'
| '-' ->
aux true (off + 1) len
| _ -> aux capital (off+1) len
Expand Down
9 changes: 8 additions & 1 deletion jscomp/ounit_tests/ounit_string_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,19 @@ let suites =
=~ "BsJson"
end;
__LOC__ >:: begin fun _ ->
let (=~) = OUnit.assert_equal ~printer:(fun x -> x) in
Ext_namespace.namespace_of_package_name
"reason-react"
=~ "ReasonReact";
Ext_namespace.namespace_of_package_name
"reason"
=~ "Reason"
=~ "Reason";
Ext_namespace.namespace_of_package_name
"@aa/bb"
=~"AaBb";
Ext_namespace.namespace_of_package_name
"@A/bb"
=~"ABb"
end;
__LOC__ >:: begin fun _ ->
Ext_namespace.js_name_of_basename false "a-b"
Expand Down
1 change: 1 addition & 0 deletions lib/bsb.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6577,6 +6577,7 @@ let namespace_of_package_name (s : string) : string =
->
add capital ch ;
aux false (off + 1) len
| '/'
| '-' ->
aux true (off + 1) len
| _ -> aux capital (off+1) len
Expand Down
1 change: 1 addition & 0 deletions lib/bsb_helper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4615,6 +4615,7 @@ let namespace_of_package_name (s : string) : string =
->
add capital ch ;
aux false (off + 1) len
| '/'
| '-' ->
aux true (off + 1) len
| _ -> aux capital (off+1) len
Expand Down
1 change: 1 addition & 0 deletions lib/whole_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57889,6 +57889,7 @@ let namespace_of_package_name (s : string) : string =
->
add capital ch ;
aux false (off + 1) len
| '/'
| '-' ->
aux true (off + 1) len
| _ -> aux capital (off+1) len
Expand Down