Skip to content

Commit 4f584e4

Browse files
committed
temporary fixing mingW Windows bug
1 parent 841d6c8 commit 4f584e4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/sys/stm_tests.ml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,16 @@ struct
215215
(s = (p path) ^ ": Not a directory" && not (path_is_a_dir fs path))
216216
| _ -> false)
217217
| Ok array_of_subdir ->
218-
mem_model fs path && path_is_a_dir fs path &&
219-
(match readdir_model fs path with
220-
| None -> false
221-
| Some l ->
222-
List.sort String.compare l
223-
= List.sort String.compare (Array.to_list array_of_subdir)))
218+
(* Temporary work around for mingW, see https://github.com/ocaml/ocaml/issues/11829 *)
219+
if Sys.win32 && not (mem_model fs path)
220+
then array_of_subdir = [||]
221+
else
222+
(mem_model fs path && path_is_a_dir fs path &&
223+
(match readdir_model fs path with
224+
| None -> false
225+
| Some l ->
226+
List.sort String.compare l
227+
= List.sort String.compare (Array.to_list array_of_subdir))))
224228
| Touch (path, _new_file_name, _perm), Res ((Int,_),n) ->
225229
if n = 0
226230
then (mem_model fs path && path_is_a_dir fs path)

0 commit comments

Comments
 (0)