Skip to content

Commit 5e29e94

Browse files
authored
Merge pull request #126 from davidanthoff/fix-save-singlearg-tests
Fix some save calls in the tests
2 parents 1a045d5 + f2a28b4 commit 5e29e94

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/error_handling.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ println("these tests will print warnings: ")
77
stderr_copy = STDERR
88
rs, wr = redirect_stdin()
99
rserr, wrerr = redirect_stderr()
10-
ref = @async save("test.not_installed")
10+
ref = @async save("test.not_installed", nothing)
1111
println(wr, "y")
1212
@test_throws CompositeException wait(ref) #("unknown package NotInstalled")
13-
ref = @async save("test.not_installed")
13+
ref = @async save("test.not_installed", nothing)
1414
println(wr, "invalid") #test invalid input
1515
println(wr, "n") # don't install
1616
wait(ref)
@@ -35,7 +35,7 @@ add_format(format"BROKEN", (), ".brok", [:BrokenIO])
3535
stderr_copy = STDERR
3636
rserr, wrerr = redirect_stderr()
3737
@test_throws FileIO.LoaderError load(Stream(format"BROKEN",STDIN))
38-
@test_throws FileIO.WriterError save(Stream(format"BROKEN",STDOUT))
38+
@test_throws FileIO.WriterError save(Stream(format"BROKEN",STDOUT), nothing)
3939
redirect_stderr(stderr_copy)
4040
close(rserr);close(wrerr)
4141
end

test/query.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module LoadTest1
3434
import FileIO: @format_str, File
3535
load(file::File{format"MultiLib"}) = error()
3636

37-
save(file::File{format"MultiLib"}) = open(file, "w") do s
37+
save(file::File{format"MultiLib"}, data) = open(file, "w") do s
3838
write(s, magic(format"MultiLib")) # Write the magic bytes
3939
write(s, 0)
4040
end
@@ -44,7 +44,7 @@ module LoadTest2
4444
import FileIO: @format_str, File, magic
4545
load(file::File{format"MultiLib"}) = 42
4646

47-
save(file::File{format"MultiLib"}) = open(file, "w") do s
47+
save(file::File{format"MultiLib"}, data) = open(file, "w") do s
4848
write(s, magic(format"MultiLib")) # Write the magic bytes
4949
write(s, 42)
5050
end
@@ -244,7 +244,7 @@ try
244244
@test length(FileIO.sym2loader[:MultiLib]) == 2
245245
@test length(FileIO.sym2saver[:MultiLib]) == 1
246246
fn = string(tempname(), ".mlb")
247-
save(fn)
247+
save(fn, nothing)
248248
x = load(fn)
249249
open(query(fn), "r") do io
250250
skipmagic(io)

0 commit comments

Comments
 (0)