Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit 0a14161

Browse files
committed
Fix 0.6 deprecations
1 parent 2928c55 commit 0a14161

File tree

2 files changed

+24
-33
lines changed

2 files changed

+24
-33
lines changed

test/broadcast.jl

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,24 @@ module TestBroadcast
7676
M = rand(Bool, 10, dims...)
7777
Y = NullableArray(B, M)
7878

79-
for op in (
80-
(.+),
81-
(.-),
82-
(.*),
83-
(./),
84-
(.%),
85-
(.^),
86-
(.==),
87-
(.!=),
88-
(.<),
89-
(.>),
90-
(.<=),
91-
(.>=),
92-
)
93-
@test isequal(op(X1, X2), NullableArray(op(A, B)))
94-
@test isequal(op(X1, Y), NullableArray(op(A, B), M))
79+
if VERSION < v"0.6.0-dev.1632"
80+
for op in (
81+
(.+),
82+
(.-),
83+
(.*),
84+
(./),
85+
(.%),
86+
(.^),
87+
(.==),
88+
(.!=),
89+
(.<),
90+
(.>),
91+
(.<=),
92+
(.>=),
93+
)
94+
@test isequal(op(X1, X2), NullableArray(op(A, B)))
95+
@test isequal(op(X1, Y), NullableArray(op(A, B), M))
96+
end
9597
end
9698

9799
A = rand(Bool, 100)
@@ -100,7 +102,7 @@ module TestBroadcast
100102
M2 = rand(Bool, 100)
101103
X = NullableArray(A, M1)
102104
Y = NullableArray(B, M2)
103-
@test isequal(broadcast(&, X, Y), NullableArray(A & B, M1 | M2))
104-
@test isequal(broadcast(|, X, Y), NullableArray(A | B, M1 | M2))
105+
@test isequal(broadcast(&, X, Y), NullableArray(A .& B, M1 .| M2))
106+
@test isequal(broadcast(|, X, Y), NullableArray(A .| B, M1 .| M2))
105107

106108
end # module

test/reduce.jl

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ module TestReduce
2424
@test isequal(mapreduce(f, +, X), Nullable(mapreduce(f, +, X.values)))
2525
@test isequal(mapreduce(f, +, Y), Nullable{Float64}())
2626
v = mapreduce(f, +, Y, skipnull=true)
27-
@test_approx_eq v.value mapreduce(f, +, B)
27+
@test v.value mapreduce(f, +, B)
2828
@test !isnull(v)
2929

3030
@test isequal(reduce(+, X), Nullable(reduce(+, X.values)))
3131
@test isequal(reduce(+, Y), Nullable{Float64}())
3232
v = reduce(+, Y, skipnull=true)
33-
@test_approx_eq v.value reduce(+, B)
33+
@test v.value reduce(+, B)
3434
@test !isnull(v)
3535

3636
for method in (
@@ -43,22 +43,11 @@ module TestReduce
4343
@test isequal(method(f, X), Nullable(method(f, A)))
4444
@test isequal(method(Y), Nullable{Float64}())
4545
v = method(Y, skipnull=true)
46-
@test_approx_eq v.value method(B)
46+
@test v.value method(B)
4747
@test !isnull(v)
4848
@test isequal(method(f, Y), Nullable{Float64}())
4949
v = method(f, Y, skipnull=true)
50-
@test_approx_eq v.value method(f, B)
51-
@test !isnull(v)
52-
end
53-
54-
for method in (
55-
sumabs,
56-
sumabs2,
57-
)
58-
@test isequal(method(X), Nullable(method(A)))
59-
@test isequal(method(Y), Nullable{Float64}())
60-
v = method(Y, skipnull=true)
61-
@test_approx_eq v.value method(B)
50+
@test v.value method(f, B)
6251
@test !isnull(v)
6352
end
6453

0 commit comments

Comments
 (0)