Skip to content

Commit

Permalink
More removal of 0.4-related code
Browse files Browse the repository at this point in the history
  • Loading branch information
TotalVerb committed Apr 27, 2017
1 parent 1a00db7 commit 53492b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
10 changes: 2 additions & 8 deletions src/Writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 53492b2

Please sign in to comment.