Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bytesavailable #483

Merged
merged 1 commit into from
Feb 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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
6 changes: 6 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down