Skip to content

Commit 2c3c5e1

Browse files
Update fs.md
Co-Authored-By: Patrick Ferris <[email protected]>
1 parent a280682 commit 2c3c5e1

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

tests/fs.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ open Eio.Std
1818
let ( / ) = Path.( / )
1919
2020
let run ?clear:(paths = []) fn =
21-
Eio_main.run @@ fun env ->
2221
let cwd = Eio.Stdenv.cwd env in
2322
List.iter (fun p -> Eio.Path.rmtree ~missing_ok:true (cwd / p)) paths;
2423
fn env
@@ -99,7 +98,6 @@ let try_chmod ~perm path =
9998
match Eio.Path.chmod ~perm path with
10099
| () -> Eio.traceln "chmod %o -> %a" perm Path.pp path
101100
| exception ex -> Eio.traceln "@[<h>%a@]" Eio.Exn.pp ex
102-
103101
```
104102

105103
# Basic test cases
@@ -1017,33 +1015,3 @@ Exception: Failure "Simulated error".
10171015
+"/" / "" = "/"
10181016
- : unit = ()
10191017
```
1020-
# Testing ``chmod``
1021-
1022-
```ocaml
1023-
let chmod_test_directory () =
1024-
run ~clear:["test-dir"] @@ fun env ->
1025-
let cwd = Eio.Stdenv.cwd env in
1026-
let dir_path = cwd / "test-dir" in
1027-
1028-
try_mkdir dir_path;
1029-
1030-
try_chmod ~perm:0o700 dir_path;
1031-
let dir_stat = Unix.stat "test-dir" in
1032-
Printf.printf "Directory permissions after chmod 0o700: %o\n" dir_stat.st_perm;
1033-
assert (dir_stat.st_perm = 0o700);
1034-
1035-
try_chmod ~perm:0o755 dir_path;
1036-
let dir_stat = Unix.stat "test-dir" in
1037-
Printf.printf "Directory permissions after chmod 0o755: %o\n" dir_stat.st_perm;
1038-
assert (dir_stat.st_perm = 0o755);
1039-
1040-
Unix.rmdir "test-dir";
1041-
()
1042-
1043-
let () =
1044-
Printf.printf "Running chmod tests...\n";
1045-
chmod_test_file ();
1046-
chmod_test_directory ();
1047-
Printf.printf "chmod tests completed successfully.\n"
1048-
1049-
```

0 commit comments

Comments
 (0)