Skip to content

Commit 997dc49

Browse files
committed
Drop compat code for printstyled from #481
1 parent b74a7de commit 997dc49

File tree

4 files changed

+13
-24
lines changed

4 files changed

+13
-24
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ Currently, the `@compat` macro supports the following syntaxes:
7373

7474
* Three-argument methods `prevind(s,i,n)`, `nextind(s,i,n)` ([#23805]), and `length(s,i,j)` ([#24999]); the latter two replace `chr2ind` and `ind2chr` in Julia 0.7, respectively.
7575

76-
* `printstyled` prints to a given stream optionally in color and/or bolded ([#25522]).
77-
7876
* `Compat.names` supporting keyword arguments for `all` and `imported` ([#25647]).
7977

8078
* `Compat.IOBuffer` supporting keyword arguments ([#25873]).

src/Compat.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,6 @@ end
7575
end
7676
end
7777

78-
# 0.7.0-DEV.3585
79-
@static if !isdefined(Base, :printstyled)
80-
printstyled(io::IO, msg...; bold=false, color=:normal) =
81-
Base.print_with_color(color, io, msg...; bold=bold)
82-
printstyled(msg...; bold=false, color=:normal) =
83-
Base.print_with_color(color, STDOUT, msg...; bold=bold)
84-
export printstyled
85-
end
86-
8778
# 0.7.0-DEV.3455
8879
@static if !isdefined(Base, :hasmethod)
8980
const hasmethod = method_exists

test/old.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,3 +709,16 @@ end
709709
@test lastindex(zeros(4)) == 4
710710
@test lastindex(zeros(4,4)) == 16
711711
@test all(x -> firstindex(x) == 1, ([1, 2], [1 2; 3 4], 'a', 1, 1=>2, `foo`, "foo", (1, 2)))
712+
713+
# 0.7.0-DEV.3585
714+
let buf = IOBuffer()
715+
if VERSION < v"0.7.0-DEV.3077"
716+
col = Base.have_color
717+
eval(Base, :(have_color = true))
718+
printstyled(buf, "foo", color=:red)
719+
eval(Base, :(have_color = $col))
720+
else
721+
printstyled(IOContext(buf, :color=>true), "foo", color=:red)
722+
end
723+
@test startswith(String(take!(buf)), Base.text_colors[:red])
724+
end

test/runtests.jl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,6 @@ end
8282

8383
@test codeunit("foo") == codeunit(SubString("fooαβγ",1,3)) == UInt8
8484

85-
# 0.7.0-DEV.3585
86-
let buf = IOBuffer()
87-
if VERSION < v"0.7.0-DEV.3077"
88-
col = Base.have_color
89-
eval(Base, :(have_color = true))
90-
printstyled(buf, "foo", color=:red)
91-
eval(Base, :(have_color = $col))
92-
else
93-
printstyled(IOContext(buf, :color=>true), "foo", color=:red)
94-
end
95-
@test startswith(String(take!(buf)), Base.text_colors[:red])
96-
end
97-
9885
# 0.7.0-DEV.3455
9986
@test hasmethod(sin, Tuple{Float64})
10087
let x = y = 1

0 commit comments

Comments
 (0)