From 32c5ae04b4d573392312c0d461a23fdcb7a774d9 Mon Sep 17 00:00:00 2001 From: nhz2 Date: Thu, 1 Aug 2024 23:44:39 -0400 Subject: [PATCH] use TestsForCodecPackages.jl --- Project.toml | 9 +-------- test/Project.toml | 6 ++++++ test/runtests.jl | 29 ++++++++++++++++------------- 3 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 test/Project.toml diff --git a/Project.toml b/Project.toml index 9925e07..fa3a41a 100644 --- a/Project.toml +++ b/Project.toml @@ -3,7 +3,7 @@ uuid = "6b39b394-51ab-5f42-8807-6242bab2b4c2" license = "MIT" authors = ["Kenta Sato ", "JuliaIO Github Organization"] -version = "0.8.4" +version = "0.8.5" [deps] TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" @@ -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"] diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..6c47331 --- /dev/null +++ b/test/Project.toml @@ -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" diff --git a/test/runtests.jl b/test/runtests.jl index 237b8cd..23fa68c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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) @@ -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()