Skip to content

Commit

Permalink
use TestsForCodecPackages.jl (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 authored Aug 11, 2024
1 parent 8dd665c commit 072dd7a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
10 changes: 1 addition & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@ name = "CodecBzip2"
uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
license = "MIT"
authors = ["Kenta Sato <[email protected]>"]
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"]
5 changes: 5 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
25 changes: 12 additions & 13 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -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)
Expand Down

2 comments on commit 072dd7a

@nhz2
Copy link
Member Author

@nhz2 nhz2 commented on 072dd7a 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/112905

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.4 -m "<description of version>" 072dd7a464f5ea84f910f2b5a5de66cfec42d6d1
git push origin v0.8.4

Please sign in to comment.