Skip to content

Commit 490a6bc

Browse files
committed
Drop compat code for printstyled from #481
1 parent 8b5ea33 commit 490a6bc

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
@@ -75,8 +75,6 @@ Currently, the `@compat` macro supports the following syntaxes:
7575

7676
* 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.
7777

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

8280
* `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
@@ -714,3 +714,16 @@ end
714714
@test lastindex(zeros(4)) == 4
715715
@test lastindex(zeros(4,4)) == 16
716716
@test all(x -> firstindex(x) == 1, ([1, 2], [1 2; 3 4], 'a', 1, 1=>2, `foo`, "foo", (1, 2)))
717+
718+
# 0.7.0-DEV.3585
719+
let buf = IOBuffer()
720+
if VERSION < v"0.7.0-DEV.3077"
721+
col = Base.have_color
722+
eval(Base, :(have_color = true))
723+
printstyled(buf, "foo", color=:red)
724+
eval(Base, :(have_color = $col))
725+
else
726+
printstyled(IOContext(buf, :color=>true), "foo", color=:red)
727+
end
728+
@test startswith(String(take!(buf)), Base.text_colors[:red])
729+
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)