Skip to content

Commit

Permalink
Modify tests to also use fileio_* version of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff committed May 22, 2018
1 parent 32cb8cb commit 38b2347
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/loadsave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ module TestLoadSave
import FileIO: File, @format_str
load(file::File{format"PBMText"}) = "PBMText"
load(file::File{format"PBMBinary"}) = "PBMBinary"
load(file::File{format"HDF5"}) = "HDF5"
load(file::File{format"JLD"}) = "JLD"
load(file::File{format"GZIP"}) = "GZIP"
end
module TestLoadSave2
import FileIO: File, @format_str
fileio_load(file::File{format"HDF5"}) = "HDF5"
end

sym2loader = copy(FileIO.sym2loader)
sym2saver = copy(FileIO.sym2saver)
Expand All @@ -23,7 +26,7 @@ try

add_loader(format"PBMText", :TestLoadSave)
add_loader(format"PBMBinary", :TestLoadSave)
add_loader(format"HDF5", :TestLoadSave)
add_loader(format"HDF5", :TestLoadSave2)
add_loader(format"JLD", :TestLoadSave)
add_loader(format"GZIP", :TestLoadSave)

Expand Down Expand Up @@ -285,12 +288,12 @@ load(f::File{format"AmbigExt2"}) = open(f) do io
read(stream(io), String)
end

save(f::File{format"AmbigExt1"}, testdata) = open(f, "w") do io
fileio_save(f::File{format"AmbigExt1"}, testdata) = open(f, "w") do io
s = stream(io)
print(s, "ambigext1")
print(s, testdata)
end
save(f::File{format"AmbigExt2"}, testdata) = open(f, "w") do io
fileio_save(f::File{format"AmbigExt2"}, testdata) = open(f, "w") do io
s = stream(io)
print(s, "ambigext2")
print(s, testdata)
Expand Down

0 comments on commit 38b2347

Please sign in to comment.