From 58adf86992f5dfd75f7c04e7cf24ed2827e6218a Mon Sep 17 00:00:00 2001 From: Olivier Nicole Date: Tue, 26 Aug 2025 17:06:38 +0200 Subject: [PATCH] Make test independent from build directory state The modified test could fail if the directory it's run in already contained a file named `append.txt`, which sometimes happened when the test has already been run previously by Dune, possibly with a different backend or profile. --- compiler/tests-ocaml/lib-unix/common/append.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/tests-ocaml/lib-unix/common/append.ml b/compiler/tests-ocaml/lib-unix/common/append.ml index accb3d5968..c0190c9636 100644 --- a/compiler/tests-ocaml/lib-unix/common/append.ml +++ b/compiler/tests-ocaml/lib-unix/common/append.ml @@ -27,6 +27,7 @@ let append () = Unix.close fd let () = + (try Unix.unlink "append.txt" with Unix.(Unix_error (ENOENT, _, _)) -> ()); append (); append (); let fd = Unix.openfile "append.txt" [ Unix.O_RDONLY ] 0o644 in