Skip to content

Commit 1fa4f7f

Browse files
committed
hope this is how you do mimes
1 parent 5349e2a commit 1fa4f7f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using FactCheck
44
facts("FileIO") do
55
include("query.jl")
66
include("loadsave.jl")
7+
include("writemime.jl")
78
end
89
# make Travis fail when tests fail:
910
FactCheck.exitstatus()

test/writemime.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Base.writemime(s::Stream{format"FileIO"}, ::MIME"test/floatvector", v::Vector{Float32}) = print(stream(s), v)
2+
context("writemime") do
3+
add_mime(MIME("test/floatvector"), Vector{Float32}, :FileIO)
4+
io = IOBuffer()
5+
t = rand(Float32, 88)
6+
writemime(io, MIME("test/floatvector"), t)
7+
@fact takebuf_string(io) --> string(t)
8+
close(io)
9+
end

0 commit comments

Comments
 (0)