# lib/std/posix/test.zig: enable disabled tests using CWD · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/d0e288ab1856a02d0556b9ceadd6fc6337ada905)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: d0e288ab1856a02d0556b9ceadd6fc6337ada905

Requested commit: d0e288ab1856a02d0556b9ceadd6fc6337ada905

Commit: d0e288ab1856a02d0556b9ceadd6fc6337ada905

Tree: 60e5e2b63f36b02a209960cdb159551d9dfec3d3

Author: Pat Tullmann

Committer: Alex Rønne Petersen

## Message

```
lib/std/posix/test.zig: enable disabled tests using CWD

Four tests in lib/std/posix/test.zig were disabled because they created
fixed-name files in the current working directory, and this caused
problems if tests were running in parallel with other build's tests.

This PR fixes those tests to all use `std.testing.tmpDir` to create unique
temporary names and directories.

Also clean the tests up to more consistently use `defer` to clean up, or
to just rely on tmpDir cleanup to remove individual files.

Working on these tests revealed a bunch of stale WASI code paths in
posix.zig, fixed by replacing stale `wast.AT.FDCWD` references with just
`AT.FDCWD`.

Fixes #14968.

```

## Parents

- [8d824dfdd06c6b0f307c6ea41dfdf316acf4a662](https://git.cafe/gitcafe/zig/commit/8d824dfdd06c6b0f307c6ea41dfdf316acf4a662?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/d0e288ab1856a02d0556b9ceadd6fc6337ada905?format=markdown)
