Skip to content

Commit

Permalink
replace ismatch with contains (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicycle1885 authored Mar 10, 2018
1 parent a1d470a commit 0780bee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
julia 0.6.0
TranscodingStreams 0.3
Compat 0.55
13 changes: 7 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CodecZlib
using Compat
if VERSION < v"0.7-"
using Base.Test
else
Expand All @@ -16,13 +17,13 @@ const testdir = @__DIR__
@testset "Gzip Codec" begin
codec = GzipCompressor()
@test codec isa GzipCompressor
@test ismatch(r"^(CodecZlib\.)?GzipCompressor\(level=-1, windowbits=\d+\)$", sprint(show, codec))
@test contains(sprint(show, codec), r"^(CodecZlib\.)?GzipCompressor\(level=-1, windowbits=\d+\)$")
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

codec = GzipDecompressor()
@test codec isa GzipDecompressor
@test ismatch(r"^(CodecZlib\.)?GzipDecompressor\(windowbits=\d+\)$", sprint(show, codec))
@test contains(sprint(show, codec), r"^(CodecZlib\.)?GzipDecompressor\(windowbits=\d+\)$")
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

Expand Down Expand Up @@ -118,13 +119,13 @@ end
@testset "Zlib Codec" begin
codec = ZlibCompressor()
@test codec isa ZlibCompressor
@test ismatch(r"^(CodecZlib\.)?ZlibCompressor\(level=-1, windowbits=\d+\)$", sprint(show, codec))
@test contains(sprint(show, codec), r"^(CodecZlib\.)?ZlibCompressor\(level=-1, windowbits=\d+\)$")
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

codec = ZlibDecompressor()
@test codec isa ZlibDecompressor
@test ismatch(r"^(CodecZlib\.)?ZlibDecompressor\(windowbits=\d+\)$", sprint(show, codec))
@test contains(sprint(show, codec), r"^(CodecZlib\.)?ZlibDecompressor\(windowbits=\d+\)$")
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

Expand Down Expand Up @@ -198,14 +199,14 @@ end
@testset "Deflate Codec" begin
codec = DeflateCompressor()
@test codec isa DeflateCompressor
@test ismatch(r"^(CodecZlib\.)?DeflateCompressor\(level=-1, windowbits=-\d+\)$", sprint(show, codec))
@test contains(sprint(show, codec), r"^(CodecZlib\.)?DeflateCompressor\(level=-1, windowbits=-\d+\)$")
@test CodecZlib.initialize(codec) === nothing
# FIXME: This test fails.
#@test CodecZlib.finalize(codec) === nothing

codec = DeflateDecompressor()
@test codec isa DeflateDecompressor
@test ismatch(r"^(CodecZlib\.)?DeflateDecompressor\(windowbits=-\d+\)$", sprint(show, codec))
@test contains(sprint(show, codec), r"^(CodecZlib\.)?DeflateDecompressor\(windowbits=-\d+\)$")
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

Expand Down

0 comments on commit 0780bee

Please sign in to comment.