Skip to content

Commit

Permalink
use TestsForCodecPackages.jl (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 authored Aug 11, 2024
1 parent 34dd3d8 commit 31cf742
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
9 changes: 1 addition & 8 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
license = "MIT"
authors = ["Kenta Sato <bicycle1885@gmail.com>",
"JuliaIO Github Organization"]
version = "0.8.4"
version = "0.8.5"

[deps]
TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
Expand All @@ -13,10 +13,3 @@ Zstd_jll = "3161d3a3-bdf6-5164-811a-617609db77b4"
TranscodingStreams = "0.9, 0.10, 0.11"
Zstd_jll = "1.5.5"
julia = "1.3"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[targets]
test = ["Test", "Random"]
6 changes: 6 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
CodecZstd = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestsForCodecPackages = "c2e61002-3542-480d-8b3c-5f05cc4f8554"
TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
29 changes: 16 additions & 13 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
using CodecZstd
using Random
using TranscodingStreams
using TestsForCodecPackages:
test_roundtrip_read,
test_roundtrip_write,
test_roundtrip_transcode,
test_roundtrip_lines,
test_roundtrip_seekstart
using Test

Random.seed!(1234)
Expand Down Expand Up @@ -39,21 +45,18 @@ Random.seed!(1234)
@test ZstdCompressorStream <: TranscodingStreams.TranscodingStream
@test ZstdDecompressorStream <: TranscodingStreams.TranscodingStream

TranscodingStreams.test_roundtrip_read(ZstdCompressorStream, ZstdDecompressorStream)
TranscodingStreams.test_roundtrip_write(ZstdCompressorStream, ZstdDecompressorStream)
TranscodingStreams.test_roundtrip_lines(ZstdCompressorStream, ZstdDecompressorStream)
TranscodingStreams.test_roundtrip_transcode(ZstdCompressor, ZstdDecompressor)
test_roundtrip_read(ZstdCompressorStream, ZstdDecompressorStream)
test_roundtrip_write(ZstdCompressorStream, ZstdDecompressorStream)
test_roundtrip_lines(ZstdCompressorStream, ZstdDecompressorStream)
test_roundtrip_transcode(ZstdCompressor, ZstdDecompressor)
test_roundtrip_seekstart(ZstdCompressorStream, ZstdDecompressorStream)

frame_encoder = io -> TranscodingStream(ZstdFrameCompressor(), io)
TranscodingStreams.test_roundtrip_read(frame_encoder, ZstdDecompressorStream)
TranscodingStreams.test_roundtrip_write(frame_encoder, ZstdDecompressorStream)
TranscodingStreams.test_roundtrip_lines(frame_encoder, ZstdDecompressorStream)
TranscodingStreams.test_roundtrip_transcode(ZstdFrameCompressor, ZstdDecompressor)

if isdefined(TranscodingStreams, :test_roundtrip_seekstart)
TranscodingStreams.test_roundtrip_seekstart(ZstdCompressorStream, ZstdDecompressorStream)
TranscodingStreams.test_roundtrip_seekstart(frame_encoder, ZstdDecompressorStream)
end
test_roundtrip_read(frame_encoder, ZstdDecompressorStream)
test_roundtrip_write(frame_encoder, ZstdDecompressorStream)
test_roundtrip_lines(frame_encoder, ZstdDecompressorStream)
test_roundtrip_transcode(ZstdFrameCompressor, ZstdDecompressor)
test_roundtrip_seekstart(frame_encoder, ZstdDecompressorStream)

@testset "ZstdFrameCompressor streaming edge case" begin
codec = ZstdFrameCompressor()
Expand Down

2 comments on commit 31cf742

@nhz2
Copy link
Member Author

@nhz2 nhz2 commented on 31cf742 Aug 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/112904

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.5 -m "<description of version>" 31cf7427f5ba8ac1e1364b7ea9dac6d0698d64be
git push origin v0.8.5

Please sign in to comment.