From 072dd7a464f5ea84f910f2b5a5de66cfec42d6d1 Mon Sep 17 00:00:00 2001 From: Nathan Zimmerberg <39104088+nhz2@users.noreply.github.com> Date: Sun, 11 Aug 2024 11:21:18 -0400 Subject: [PATCH] use TestsForCodecPackages.jl (#34) --- Project.toml | 10 +--------- test/Project.toml | 5 +++++ test/runtests.jl | 25 ++++++++++++------------- 3 files changed, 18 insertions(+), 22 deletions(-) create mode 100644 test/Project.toml diff --git a/Project.toml b/Project.toml index 750c96b..4defa5c 100644 --- a/Project.toml +++ b/Project.toml @@ -2,21 +2,13 @@ name = "CodecBzip2" uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" license = "MIT" authors = ["Kenta Sato "] -version = "0.8.3" +version = "0.8.4" [deps] Bzip2_jll = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" [compat] Bzip2_jll = "1.0.8" TranscodingStreams = "0.9, 0.10, 0.11" 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..77ae80a --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,5 @@ +[deps] +CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" +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 f29b01d..d01e397 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,11 +1,12 @@ using CodecBzip2 -using Random -if VERSION > v"0.7-" - using Test -else - using Base.Test -end +using Test import TranscodingStreams +using TestsForCodecPackages: + test_roundtrip_read, + test_roundtrip_write, + test_roundtrip_transcode, + test_roundtrip_lines, + test_roundtrip_seekstart @testset "Bzip2 Codec" begin codec = Bzip2Compressor() @@ -35,13 +36,11 @@ import TranscodingStreams @test Bzip2CompressorStream <: TranscodingStreams.TranscodingStream @test Bzip2DecompressorStream <: TranscodingStreams.TranscodingStream - TranscodingStreams.test_roundtrip_read(Bzip2CompressorStream, Bzip2DecompressorStream) - TranscodingStreams.test_roundtrip_write(Bzip2CompressorStream, Bzip2DecompressorStream) - TranscodingStreams.test_roundtrip_lines(Bzip2CompressorStream, Bzip2DecompressorStream) - if isdefined(TranscodingStreams, :test_roundtrip_seekstart) - TranscodingStreams.test_roundtrip_seekstart(Bzip2CompressorStream, Bzip2DecompressorStream) - end - TranscodingStreams.test_roundtrip_transcode(Bzip2Compressor, Bzip2Decompressor) + test_roundtrip_read(Bzip2CompressorStream, Bzip2DecompressorStream) + test_roundtrip_write(Bzip2CompressorStream, Bzip2DecompressorStream) + test_roundtrip_lines(Bzip2CompressorStream, Bzip2DecompressorStream) + test_roundtrip_seekstart(Bzip2CompressorStream, Bzip2DecompressorStream) + test_roundtrip_transcode(Bzip2Compressor, Bzip2Decompressor) @test_throws ArgumentError Bzip2Compressor(blocksize100k=10) @test_throws ArgumentError Bzip2Compressor(workfactor=251)