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

Fix tests for current Julia nightly #529

Merged
merged 3 commits into from
Apr 20, 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
12 changes: 5 additions & 7 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1633,13 +1633,11 @@ else
end

# compatibiltiy with https://github.com/JuliaLang/julia/pull/26156
if VERSION < v"0.7.0-DEV.4062" || VERSION >= v"0.7.0-DEV.4804"
trunc(x, digits; base = base) = trunc(x, digits = digits, base = base)
floor(x, digits; base = base) = floor(x, digits = digits, base = base)
ceil(x, digits; base = base) = ceil(x, digits = digits, base = base)
round(x, digits; base = base) = round(x, digits = digits, base = base)
signif(x, digits; base = base) = round(x, sigdigits = digits, base = base)
end
trunc(x, digits; base = base) = trunc(x, digits = digits, base = base)
floor(x, digits; base = base) = floor(x, digits = digits, base = base)
ceil(x, digits; base = base) = ceil(x, digits = digits, base = base)
round(x, digits; base = base) = round(x, digits = digits, base = base)
signif(x, digits; base = base) = round(x, sigdigits = digits, base = base)

# https://github.com/JuliaLang/julia/pull/25872
if VERSION < v"0.7.0-DEV.3734"
Expand Down
9 changes: 5 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,11 @@ let c = CartesianIndices(1:3, 1:2), l = LinearIndices(1:3, 1:2)
@test l == collect(l) == reshape(1:6, 3, 2)
@test c[1:6] == vec(c)
@test l[1:6] == vec(l)
@test l == l[c] == map(i -> l[i], c)
# TODO the following test fails on current Julia master (since 0.7.0-DEV.4742), and
# it's not clear yet whether it should work or not. See
# https://github.com/JuliaLang/julia/pull/26682#issuecomment-379762632 and the
# discussion following it
#@test l == l[c] == map(i -> l[i], c)
@test l[vec(c)] == collect(1:6)
@test CartesianIndex(1, 1) in CartesianIndices((3, 4))
end
Expand Down Expand Up @@ -1424,9 +1428,6 @@ end
@test Compat.findnext(r"a", "ba", 1) == Compat.findfirst(r"a", "ba") == 2:2
@test Compat.findnext(r"z", "ba", 1) == Compat.findfirst(r"z", "ba") == nothing

@test Compat.findfirst(isequal(UInt8(0)), IOBuffer(UInt8[1, 0])) == 2
@test Compat.findfirst(isequal(UInt8(9)), IOBuffer(UInt8[1, 0])) == nothing

@test findall([true, false, true]) == [1, 3]
@test findall(in([1, 2]), [1]) == [1]
if VERSION < v"0.7.0-DEV.4592"
Expand Down