From 5de8cd01308a2b31352e35b62fab621dc15c1008 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Mon, 9 Apr 2018 11:18:52 +0200 Subject: [PATCH 1/3] Disable a Cartesian- and LinearIndices test broken Julia 0.7 --- test/runtests.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index f5aa7a2e2..244dc321b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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 From 0d772759db0a2b43525483c14c6c8f8e3991d583 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Mon, 9 Apr 2018 11:27:52 +0200 Subject: [PATCH 2/3] Remove tests for findfirst on IOBuffer --- test/runtests.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 244dc321b..055fccf8f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1428,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" From eec1e2cf89e2e1f09791515568f764552e75f2e4 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Fri, 20 Apr 2018 09:56:27 +0200 Subject: [PATCH 3/3] Define `Compat.round(x, digits; base = base)` on all versions of Julia Even where `Base` has these methods, we still need to provide them as methods to the corresponding `Compat` functions. --- src/Compat.jl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Compat.jl b/src/Compat.jl index 3cf475399..fe4bcda30 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -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"