diff --git a/src/Writer.jl b/src/Writer.jl index 7553293..505f059 100644 --- a/src/Writer.jl +++ b/src/Writer.jl @@ -46,13 +46,7 @@ function lower(a) end end -if isdefined(Base, :Dates) - lower(s::Base.Dates.TimeType) = string(s) -end - -if VERSION < v"0.5.0-dev+2396" - lower(f::Function) = "function at $(f.fptr)" -end +lower(s::Base.Dates.TimeType) = string(s) lower(c::Char) = string(c) lower(d::Type) = string(d) @@ -246,7 +240,7 @@ show_json(io::SC, ::CS, x::Union{AbstractString, Symbol}) = show_string(io, x) function show_json(io::SC, s::CS, x::Union{Integer, AbstractFloat}) # workaround for issue in Julia 0.5.x where Float32 values are printed as # 3.4f-5 instead of 3.4e-5 - @static if v"0.5-" <= VERSION < v"0.6.0-dev.788" + @static if VERSION < v"0.6.0-dev.788" if isa(x, Float32) return show_json(io, s, Float64(x)) end diff --git a/test/runtests.jl b/test/runtests.jl index bd971f8..19bd84e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -49,11 +49,7 @@ validate_unicode(unicode) = begin end # ------- -if VERSION >= v"0.5.0-dev+1343" - finished_async_tests = RemoteChannel() -else - finished_async_tests = RemoteRef() -end +finished_async_tests = RemoteChannel() @async begin s = listen(7777) @@ -267,10 +263,6 @@ end @test Float32(JSON.parse(json(2.1f-8))) == 2.1f-8 # Check printing of more exotic objects -if VERSION < v"0.5.0-dev+2396" - # Test broken in v0.5, code is using internal structure of Function type! - @test sprint(JSON.print, sprint) == string("\"function at ", sprint.fptr, "\"") -end @test sprint(JSON.print, Float64) == string("\"Float64\"") @test_throws ArgumentError sprint(JSON.print, JSON)