diff --git a/README.md b/README.md index 15265e33d..1f7795178 100644 --- a/README.md +++ b/README.md @@ -328,6 +328,8 @@ Currently, the `@compat` macro supports the following syntaxes: * `endof` is now `lastindex` ([#25458]). (Note that `lastindex(A, n)` is not supported.) +* `nb_available` is now `bytesavailable` ([#25634]). + ## New macros * `@__DIR__` has been added ([#18380]) @@ -518,6 +520,7 @@ includes this fix. Find the minimum version from there. [#25622]: https://github.com/JuliaLang/julia/issues/25622 [#25628]: https://github.com/JuliaLang/julia/issues/25628 [#25629]: https://github.com/JuliaLang/julia/issues/25629 +[#25634]: https://github.com/JuliaLang/julia/issues/25634 [#25646]: https://github.com/JuliaLang/julia/issues/25646 [#25654]: https://github.com/JuliaLang/julia/issues/25654 [#24182]: https://github.com/JuliaLang/julia/issues/24182 diff --git a/src/Compat.jl b/src/Compat.jl index 4d31c6086..ea464cecd 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -1497,6 +1497,12 @@ end export AbstractDisplay end +# 0.7.0-DEV.3481 +@static if !isdefined(Base, :bytesavailable) + const bytesavailable = nb_available + export bytesavailable +end + # 0.7.0-DEV.3583 @static if !isdefined(Base, :lastindex) const lastindex = endof diff --git a/test/runtests.jl b/test/runtests.jl index 8bbfb6749..a3a28a206 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1295,6 +1295,12 @@ end @test eltype(Base.Multimedia.displays) <: AbstractDisplay +# 0.7.0-DEV.3481 +let b = IOBuffer() + write(b, "hi") + @test bytesavailable(b) == 0 +end + # 0.7.0-DEV.3583 @test lastindex(zeros(4)) == 4 @test lastindex(zeros(4,4)) == 16