Skip to content

Commit

Permalink
Added tests to reconstruct an undef fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mauro3 committed Oct 9, 2021
1 parent 445548a commit 4fd3ae9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ end

struct S end

struct Bar
a
Bar() = new()
end

module A
using DataFrames, BSON
d = DataFrame(a = 1:10, b = rand(10))
Expand All @@ -39,6 +44,22 @@ end
@test roundtrip_equal("b")
@test roundtrip_equal([1,"b"])
@test roundtrip_equal(Tuple)
@test roundtrip_equal(Tuple{Int, Float64})
@test roundtrip_equal(Vararg{Any})
end

@testset "Undefined References" begin
# from Issue #3
d = Dict(:a => 1, :b => Dict(:c => 3, :d => Dict("e" => 5)))
@test roundtrip_equal(d)

# from Issue #43
x = Array{String, 1}(undef, 5)
x[1] = "a"
x[4] = "d"
@test_broken roundtrip_equal(Dict(:x => x))

@test roundtrip_equal(Bar())
end

@testset "Complex Types" begin
Expand Down

0 comments on commit 4fd3ae9

Please sign in to comment.