I think it's not really expected but the current implementation of Support.remove_extension does not have the same behavior as Filename.remove_extension (on OCaml 4.14).
extension_pos name =
let n = String.length name in
let r = try String.rindex name '.' with Not_found -> n-1 in
if r = 0 then
try String.rindex name '.' with Not_found -> n-1
else r
let extension name =
let n = String.length name in
let r = extension_pos name in
String.sub name (r+1) (n-r-1)
let remove_extension name =
let r = extension_pos name in
String.sub name 0 r
let () = print_endline (remove_extension "foo")
let () = assert (remove_extension "foo" = Filename.remove_extension "foo")
I think it's not really expected but the current implementation of
Support.remove_extension
does not have the same behavior asFilename.remove_extension
(on OCaml 4.14).