diff --git a/.gitignore b/.gitignore index 8c960ec..33ea5c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.jl.cov *.jl.*.cov *.jl.mem +Manifest.toml +test.bson diff --git a/src/extensions.jl b/src/extensions.jl index da75d19..deb7bfc 100644 --- a/src/extensions.jl +++ b/src/extensions.jl @@ -1,4 +1,5 @@ lower(x::Dict{Symbol}) = BSONDict(x) +lower(x::BSONDict) = BSONDict(x) # Basic Types diff --git a/test.bson b/test.bson deleted file mode 100644 index 12e318f..0000000 Binary files a/test.bson and /dev/null differ diff --git a/test/runtests.jl b/test/runtests.jl index f2165ca..f7f5fb5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,17 @@ using BSON using Test -roundtrip_equal(x) = BSON.roundtrip(x) == x +function roundtrip_equal(x) + y = BSON.roundtrip(x) + typeof(y) == typeof(x) && x == y +end + +# avoid hitting bug where +# Dict{Symbol,T} -> Dict{Symbol,Any} +function roundtrip_equal(x::Dict{Symbol}) + y = BSON.roundtrip(x) + y isa Dict{Symbol} && y == x +end mutable struct Foo x