Skip to content

Commit 7432dc0

Browse files
committed
Write fix for Julia v0.7
Removes ::AbstractVector{Record}, which is neither captured for other versions of Julia.
1 parent b11719c commit 7432dc0

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/writer.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"Write [`Record`](@ref)s to `IO` as string."
2-
function Base.write(io::IO, records::Union{Vector{Record}, <:AbstractVector{Record}}) #Note: catching non-isbits arrays and we assume the indexes have been bumpped and the open ends are correct.
2+
function Base.write(io::IO, records::Vector{Record}) #Note: catching non-isbits arrays and we assume the indexes have been bumpped and the open ends are correct.
33
for record in records
44
Base.write(io, record, '\n')
55
end

test/runtests.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ end
149149
@test Bag.records == read(io, Vector{Record})
150150
end
151151

152+
# Not able to capture write(::IO, ::AbstractVector).
153+
# @test_nowarn mktemp() do path, io
154+
# # test AbstractVector
155+
# records = view(Bag.records, 2:4)
156+
# header = Bedgraph.generateBasicHeader(records)
157+
# write(io, header, records)
158+
#
159+
# seekstart(io)
160+
# @test records == read(io, Vector{Record})
161+
# end
162+
152163
@test_nowarn mktemp() do path, io
153164
header = Bedgraph.generateBasicHeader("chr19", Bag.records[1].first, Bag.records[end].last, bump_forward=false)
154165
write(io, header, Bag.records)

0 commit comments

Comments
 (0)