diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-12 18:51:27 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-12 18:51:27 +0200 |
| commit | a4ac3cc6e8de8902e7b0bc6bdddfd3fb54ffeb7a (patch) | |
| tree | 35e36589032374b793e6b76bfc3e8d9db6302423 /tests | |
| parent | b71e0c2e3673b5b712847cf67e9a196a4d2d136b (diff) | |
fix `os.read_dir` closing the given file descriptor
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/core/os/os.odin | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/core/os/os.odin b/tests/core/os/os.odin index 0beac67a6..1510bad31 100644 --- a/tests/core/os/os.odin +++ b/tests/core/os/os.odin @@ -32,7 +32,9 @@ read_dir :: proc(t: ^testing.T) { fd, err := os.open(#directory + "/dir") testing.expect_value(t, err, nil) - defer os.close(fd) + defer { + testing.expect_value(t, os.close(fd), nil) + } dir, err2 := os.read_dir(fd, -1) testing.expect_value(t, err2, nil) @@ -58,4 +60,4 @@ read_dir :: proc(t: ^testing.T) { testing.expect_value(t, dir[2].name, "sub") testing.expect(t, dir[2].is_dir, "is not a directory") } -}
\ No newline at end of file +} |