compress.zlib: changed to pure V RFC-compliant code#27162
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5a66136f4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Bounce to re-run CI. |
|
|
||
| fn test_zlib_roundtrip_text() { | ||
| data := 'Hello world!'.bytes() | ||
| compressed := compress(data)! |
There was a problem hiding this comment.
| compressed := compress(data)! | |
| compressed := compress(data)! | |
| assert compressed != data |
There was a problem hiding this comment.
It may be a good idea, to verify that compress does not just return its input.
There was a problem hiding this comment.
I suppose it couldn't hurt, but it should never be necessary. zlib will always add it's header to the output, so even if the original data is unchanged, the output will always be different due to that header.
There was a problem hiding this comment.
The confusion may be that it is calling compress, not compress_zlib. However, the default type if you call compress is zlib compression, not raw compression.
I debated about what the default should be... I'm thinking now that the default probably should be raw compression, without adding the zlib/gzip headers. Then this test would directly call compress_zlib, hopefully clearing the confusion.
What do you think, @spytheman ?
Also added
interopsubdir with tests for full V<->C<->Python cross-validation.