janet-lang / spork

Various Janet utility modules - the official "Contrib" library.
MIT License
122 stars 35 forks source link

Test fails on Windows 10: compress -> decompress round trip #97

Closed sogaiu closed 1 year ago

sogaiu commented 1 year ago

With 63f656e6 on a Windows 10 machine, I see an error in the output of jpm test:

running test/suite-zip.janet ...
✘  compress -> decompress round trip
test suite test/suite-zip.janet finished in 0.001 seconds - 0 of 1 tests passed.
non-zero exit code in test/suite-zip.janet: 1

I put some debugging prints before:

(assert (= file-contents (string bytes)) "compress -> decompress round trip")

I got a length of 6000 for file-contents and 0 for bytes. Verified that bytes was a buffer too.

Test passes fine on a Linux box (and the lengths for file-contents and bytes are both 6000).

sogaiu commented 1 year ago

Adding (zip/writer-close w) after (zip/writer-finalize w) makes things work here.

Perhaps it has something to do with this...

sogaiu commented 1 year ago

The test passes for me now.