Skip to content

Commit d434ab6

Browse files
iamed2bicycle1885
authored andcommitted
Fix loading on 0.7 and reenable testing (without coverage) (#33)
* Get package working on Julia 0.7 * Reenable nightly testing but disable coverage
1 parent c23720c commit d434ab6

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ os:
44
# - osx
55
julia:
66
- 0.6
7-
# - nightly
7+
- nightly
88
matrix:
99
allow_failures:
1010
- julia: nightly
@@ -16,7 +16,7 @@ notifications:
1616
# - julia -e 'Pkg.clone(pwd()); Pkg.build("TranscodingStreams"); Pkg.test("TranscodingStreams"; coverage=true)'
1717
after_success:
1818
# push coverage results to Codecov
19-
- julia -e 'cd(Pkg.dir("TranscodingStreams")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
19+
- if [ $TRAVIS_JULIA_VERSION != "nightly" ]; then julia -e 'cd(Pkg.dir("TranscodingStreams")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
2020
# deploy docs
2121
- julia -e 'Pkg.add("Documenter")'
2222
- julia -e 'cd(Pkg.dir("TranscodingStreams")); include(joinpath("docs", "make.jl"))'

src/testtools.jl

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Test Tools
22
# ==========
33

4+
import Base.Test
5+
46
TEST_RANDOM_SEED = 12345
57

68
function test_roundtrip_read(encoder, decoder)
@@ -9,7 +11,7 @@ function test_roundtrip_read(encoder, decoder)
911
data = rand(alpha, n)
1012
file = IOBuffer(data)
1113
stream = decoder(encoder(file))
12-
Base.Test.@test hash(read(stream)) == hash(data)
14+
Test.@test hash(read(stream)) == hash(data)
1315
close(stream)
1416
end
1517
end
@@ -21,7 +23,7 @@ function test_roundtrip_write(encoder, decoder)
2123
file = IOBuffer()
2224
stream = encoder(decoder(file))
2325
write(stream, data, TOKEN_END); flush(stream)
24-
Base.Test.@test hash(take!(file)) == hash(data)
26+
Test.@test hash(take!(file)) == hash(data)
2527
close(stream)
2628
end
2729
end
@@ -32,8 +34,8 @@ function test_roundtrip_transcode(encode, decode)
3234
decoder = decode()
3335
for n in vcat(0:30, sort!(rand(500:100_000, 30))), alpha in (0x00:0xff, 0x00:0x0f)
3436
data = rand(alpha, n)
35-
Base.Test.@test hash(transcode(decode, transcode(encode, data))) == hash(data)
36-
Base.Test.@test hash(transcode(decoder, transcode(encoder, data))) == hash(data)
37+
Test.@test hash(transcode(decode, transcode(encode, data))) == hash(data)
38+
Test.@test hash(transcode(decoder, transcode(encoder, data))) == hash(data)
3739
end
3840
finalize(encoder)
3941
finalize(decoder)
@@ -52,7 +54,7 @@ function test_roundtrip_lines(encoder, decoder)
5254
write(stream, TOKEN_END)
5355
flush(stream)
5456
seekstart(buf)
55-
Base.Test.@test hash(lines) == hash(readlines(decoder(buf)))
57+
Test.@test hash(lines) == hash(readlines(decoder(buf)))
5658
end
5759

5860
function test_roundtrip_fileio(Encoder, Decoder)
@@ -64,7 +66,7 @@ function test_roundtrip_fileio(Encoder, Decoder)
6466
write(stream, data)
6567
close(stream)
6668
stream = TranscodingStream(Decoder(), open(filename))
67-
Base.Test.@test hash(read(stream)) == hash(data)
69+
Test.@test hash(read(stream)) == hash(data)
6870
close(stream)
6971
end
7072
end
@@ -85,7 +87,7 @@ function test_chunked_read(Encoder, Decoder)
8587
ok &= hash(read(stream)) == hash(chunk)
8688
ok &= eof(stream)
8789
end
88-
Base.Test.@test ok
90+
Test.@test ok
8991
close(stream)
9092
end
9193
finalize(encoder)
@@ -106,7 +108,7 @@ function test_chunked_write(Encoder, Decoder)
106108
ok = true
107109
ok &= hash(take!(buffer)) == hash(chunks[1])
108110
ok &= buffersize(stream.state.buffer1) == length(data[2])
109-
Base.Test.@test ok
111+
Test.@test ok
110112
close(stream)
111113
end
112114
finalize(encoder)

test/runtests.jl

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ for pkg in ["CodecZlib", "CodecBzip2", "CodecXz", "CodecZstd", "CodecBase"]
127127
end
128128

129129
# TODO: This should be moved to CodecZlib.jl.
130+
import CodecZlib
130131
import CodecZlib: GzipCompression, GzipDecompression
131132
TranscodingStreams.test_chunked_read(GzipCompression, GzipDecompression)
132133
TranscodingStreams.test_chunked_write(GzipCompression, GzipDecompression)

0 commit comments

Comments
 (0)