Skip to content

Commit

Permalink
add test for missing tuple field
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasIsensee committed Sep 8, 2024
1 parent ddd7177 commit f057a2a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/loadsave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -757,3 +757,25 @@ end
end
end
end


@testset "Missing Types in Tuples" begin
cd(mktempdir()) do
eval(:(module ModuleWithFunction
fun(x) = x+1
end))
eval(:(save_object("test.jld2", (1, ModuleWithFunction.fun, 2))))
obj = load_object("test.jld2")
@test length(obj) == 3
@test obj[1] == 1
@test obj[2] == eval(:(ModuleWithFunction.fun))
@test obj[3] == 2

eval(:(module ModuleWithFunction end))
obj = load_object("test.jld2")
@test length(obj) == 3
@test obj[1] == 1
@test JLD2.isreconstructed(obj[2])
@test obj[3] == 2
end
end

0 comments on commit f057a2a

Please sign in to comment.