We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 083dc41 + 7336f81 commit 686bd24Copy full SHA for 686bd24
base/show.jl
@@ -891,6 +891,7 @@ xdump(fn::Function, io::IO, args...) = throw(ArgumentError("invalid arguments to
891
xdump(fn::Function, args...) = xdump(fn, STDOUT::IO, args...)
892
xdump(io::IO, args...) = xdump(xdump, io, args...)
893
xdump(args...) = with_output_limit(()->xdump(xdump, STDOUT::IO, args...), true)
894
+xdump(arg::IO) = xdump(xdump, STDOUT::IO, arg)
895
896
# Here are methods specifically for dump:
897
dump(io::IO, x, n::Int) = dump(io, x, n, "")
@@ -900,6 +901,7 @@ dump(io::IO, x::AbstractString, n::Int, indent) =
900
901
show(io, x); println(io))
902
dump(io::IO, x, n::Int, indent) = xdump(dump, io, x, n, indent)
903
dump(io::IO, args...) = throw(ArgumentError("invalid arguments to dump"))
904
+dump(arg::IO) = xdump(dump, STDOUT::IO, arg)
905
dump(args...) = with_output_limit(()->dump(STDOUT::IO, args...), true)
906
907
function dump(io::IO, x::Dict, n::Int, indent)
test/show.jl
@@ -269,3 +269,12 @@ end
269
@test_repr "bitstype 100 B"
270
@test repr(:(bitstype A B)) == ":(bitstype A B)"
271
@test repr(:(bitstype 100 B)) == ":(bitstype 100 B)"
272
+
273
+oldout = STDOUT
274
+try
275
+ rd, wr = redirect_stdout()
276
+ @test dump(STDERR) == nothing
277
+ @test xdump(STDERR) == nothing
278
+finally
279
+ redirect_stdout(oldout)
280
+end
0 commit comments