# std.compress: Improve tests, remove reliance on openDirAbsolute · gitcafe/zig

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

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

Visibility: public

Requested revision: 077b003c50065a8b193dcad793ca5c4474222af6

Requested commit: 077b003c50065a8b193dcad793ca5c4474222af6

Commit: 077b003c50065a8b193dcad793ca5c4474222af6

Tree: c30a616f3130b2ed70ddfb418bf28e36ec15ad0a

Author: Ryan Liptak

Committer: Andrew Kelley

## Message

```
std.compress: Improve tests, remove reliance on openDirAbsolute

- Previously, some of the compress tests used `@src()` in combination with `dirname` and `openDirAbsolute` to read test files at runtime, which both excludes platforms that `openDirAbsolute` is not implemented for (WASI) and platforms that `SourceLocation.file` is not absolute (this was true for me locally on Windows). Instead of converting the tests to use `fs.cwd().openDir`, they have been converted to use `@embedFile` to avoid any potential problems with the runtime cwd.
- In order to use `@embedFile`, some of the `[]u8` parameters needed to be changed to `[]const u8`; none of them needed to be non-const anyway
- The tests now use `expectEqual` and `expectEqualSlices` where appropriate for better diagnostics

```

## Parents

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

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