Skip to content

Commit

Permalink
Drop compat code for read(obj, ::Type{String}) from #385 and #580
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 4115e15 commit 8759c33
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `reprmime(mime, x)` is now `repr(mime, x)` ([#25990]) and `mimewritable` is now `showable` ([#26089]).

* `readstring` is replaced by methods of `read`. ([#22864])

`read(::IO, ::Type{String})`, `read(::AbstractString, ::Type{String})`,
and `read(::AbstractCmd, ::Type{String})` are defined for 0.6 and below.

* `Range` is now `AbstractRange` ([#23570])

* `select`* functions (`select`, `select!`, `selectperm`, `selectperm!`) are renamed to
Expand Down
6 changes: 0 additions & 6 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ end

include("compatmacro.jl")

if VERSION < v"0.7.0-DEV.1053"
Base.read(obj::IO, ::Type{String}) = readstring(obj)
Base.read(obj::AbstractString, ::Type{String}) = readstring(obj)
Base.read(obj::Base.AbstractCmd, ::Type{String}) = readstring(obj)
end

# https://github.com/JuliaLang/julia/pull/20005
if VERSION < v"0.7.0-DEV.896"
Base.InexactError(name::Symbol, T, val) = InexactError()
Expand Down
8 changes: 8 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,11 @@ struct TestType
end
@test fieldcount(TestType) == 2
@test fieldcount(Int) == 0

# 0.7
@test read(IOBuffer("aaaa"), String) == "aaaa"
@test occursin("read(@__FILE__, String)", read(@__FILE__, String))
let cmd = `$(Base.julia_cmd()) --startup-file=no -e "println(:aaaa)"`
@test read(cmd, String) == "aaaa\n"
@test read(pipeline(cmd, stderr=devnull), String) == "aaaa\n"
end
8 changes: 0 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@ let
@test vec([b for (a,b) in pairs(IndexCartesian(), A14)]) == [11,12,13,14]
end

# 0.7
@test read(IOBuffer("aaaa"), String) == "aaaa"
@test occursin("read(@__FILE__, String)", read(@__FILE__, String))
let cmd = `$(Base.julia_cmd()) --startup-file=no -e "println(:aaaa)"`
@test read(cmd, String) == "aaaa\n"
@test read(pipeline(cmd, stderr=devnull), String) == "aaaa\n"
end

# 0.7
@test isa(1:2, AbstractRange)

Expand Down

0 comments on commit 8759c33

Please sign in to comment.