Make read_dir tests consistent with others

This commit is contained in:
Patrick Ferris 2022-05-23 12:58:12 +01:00
parent 4a9bde55f6
commit d7b5465ed6

View File

@ -33,8 +33,8 @@ let try_mkdir dir path =
let try_read_dir dir path =
match Eio.Dir.read_dir dir path with
| names -> traceln "read_dir [ %a ] -> ok" Fmt.(list ~sep:Fmt.comma string) names
| exception ex -> traceln "read_dir %a" Fmt.exn ex
| names -> traceln "read_dir %S -> %a" path Fmt.Dump.(list string) names
| exception ex -> traceln "read_dir %S -> %a" path Fmt.exn ex
let chdir path =
traceln "chdir %S" path;
@ -245,9 +245,9 @@ Reading directory entries under `cwd` and outside of `cwd`.
+chdir "readdir"
+mkdir "test-1" -> ok
+mkdir "test-2" -> ok
+read_dir [ test-1, test-2 ] -> ok
+read_dir Eio.Dir.Permission_denied ("..", _)
+read_dir Eio.Dir.Not_found ("test-3", _)
+read_dir "." -> ["test-1"; "test-2"]
+read_dir ".." -> Eio.Dir.Permission_denied ("..", _)
+read_dir "test-3" -> Eio.Dir.Not_found ("test-3", _)
+chdir ".."
- : unit = ()
```