Skip to content

Commit

Permalink
Fix arrays test failure on Julia 0.6
Browse files Browse the repository at this point in the history
compact() was overwritten by the boolean from the loop.
  • Loading branch information
nalimilan committed Nov 30, 2016
1 parent 4343612 commit eb63e31
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
30 changes: 15 additions & 15 deletions test/11_array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ for ordered in (false, true)
@test CategoricalVector{String, DefaultRefType}(a, ordered=ordered) == x
@test CategoricalVector{String, UInt8}(a, ordered=ordered) == x

for (y, R1, R2, compact) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
for (y, R1, R2, comp) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
x2 = categorical(y, ordered=ordered)
@test x2 == x
@test isa(x2, CategoricalVector{String, R1})
@test isordered(x2) === ordered

x2 = categorical(y, compact, ordered=ordered)
x2 = categorical(y, comp, ordered=ordered)
@test x2 == x
@test isa(x2, CategoricalVector{String, R2})
@test isordered(x2) === ordered
Expand Down Expand Up @@ -317,16 +317,16 @@ for ordered in (false, true)
@test CategoricalVector{Float64, DefaultRefType}(a, ordered=ordered) == x
@test CategoricalVector{Float32, DefaultRefType}(a, ordered=ordered) == x

for (y, R1, R2, compact) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
for (y, R1, R2, comp) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
x2 = categorical(y, ordered=ordered)
@test x2 == x
@test isa(x2, CategoricalVector{Float64, R1})
@test isordered(x2) === ordered

x2 = categorical(y, compact, ordered=ordered)
x2 = categorical(y, comp, ordered=ordered)
@test x2 == x
@test isa(x2, CategoricalVector{Float64, R2})
@test isordered(x2) === ordered
Expand Down Expand Up @@ -487,16 +487,16 @@ for ordered in (false, true)
@test CategoricalMatrix{String, DefaultRefType}(a, ordered=ordered) == x
@test CategoricalMatrix{String, UInt8}(a, ordered=ordered) == x

for (y, R1, R2, compact) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
for (y, R1, R2, comp) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
x2 = categorical(y, ordered=ordered)
@test x2 == x
@test isa(x2, CategoricalMatrix{String, R1})
@test isordered(x2) === ordered

x2 = categorical(y, compact, ordered=ordered)
x2 = categorical(y, comp, ordered=ordered)
@test x2 == x
@test isa(x2, CategoricalMatrix{String, R2})
@test isordered(x2) === ordered
Expand Down
50 changes: 25 additions & 25 deletions test/12_nullablearray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ for ordered in (false, true)
@test NullableCategoricalVector{String, DefaultRefType}(a, ordered=ordered) == x
@test NullableCategoricalVector{String, UInt8}(a, ordered=ordered) == x

for (y, R1, R2, compact) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
for (y, R1, R2, comp) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
x2 = categorical(y, ordered=ordered)
@test x2 == y
if eltype(y) <: Nullable
Expand All @@ -99,7 +99,7 @@ for ordered in (false, true)
end
@test isordered(x2) === ordered

x2 = categorical(y, compact, ordered=ordered)
x2 = categorical(y, comp, ordered=ordered)
@test x2 == y
if eltype(y) <: Nullable
@test isa(x2, NullableCategoricalVector{String, R2})
Expand Down Expand Up @@ -335,16 +335,16 @@ for ordered in (false, true)
@test NullableCategoricalVector{String, DefaultRefType}(a, ordered=ordered) == x
@test NullableCategoricalVector{String, UInt8}(a, ordered=ordered) == x

for (y, R1, R2, compact) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
for (y, R1, R2, comp) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
x2 = categorical(y, ordered=ordered)
@test x2 == y
@test isa(x2, NullableCategoricalVector{String, R1})
@test isordered(x2) === ordered

x2 = categorical(y, compact, ordered=ordered)
x2 = categorical(y, comp, ordered=ordered)
@test x2 == y
@test isa(x2, NullableCategoricalVector{String, R2})
@test isordered(x2) === ordered
Expand Down Expand Up @@ -504,10 +504,10 @@ for ordered in (false, true)
@test NullableCategoricalVector{Float64, DefaultRefType}(a, ordered=ordered) == x
@test NullableCategoricalVector{Float32, DefaultRefType}(a, ordered=ordered) == x

for (y, R1, R2, compact) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
for (y, R1, R2, comp) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
x2 = categorical(y, ordered=ordered)
@test x2 == collect(y)
if eltype(y) <: Nullable
Expand All @@ -517,7 +517,7 @@ for ordered in (false, true)
end
@test isordered(x2) === ordered

x2 = categorical(y, compact, ordered=ordered)
x2 = categorical(y, comp, ordered=ordered)
@test x2 == collect(y)
if eltype(y) <: Nullable
@test isa(x2, NullableCategoricalVector{Float64, R2})
Expand Down Expand Up @@ -692,10 +692,10 @@ for ordered in (false, true)
@test NullableCategoricalMatrix{String, DefaultRefType}(a, ordered=ordered) == x
@test NullableCategoricalMatrix{String, UInt8}(a, ordered=ordered) == x

for (y, R1, R2, compact) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
for (y, R1, R2, comp) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
x2 = categorical(y, ordered=ordered)
@test x2 == y
if eltype(y) <: Nullable
Expand All @@ -705,7 +705,7 @@ for ordered in (false, true)
end
@test isordered(x2) === ordered

x2 = categorical(y, compact, ordered=ordered)
x2 = categorical(y, comp, ordered=ordered)
@test x2 == y
if eltype(y) <: Nullable
@test isa(x2, NullableCategoricalMatrix{String, R2})
Expand Down Expand Up @@ -850,16 +850,16 @@ for ordered in (false, true)
@test NullableCategoricalMatrix{String, DefaultRefType}(a, ordered=ordered) == x
@test NullableCategoricalMatrix{String, UInt8}(a, ordered=ordered) == x

for (y, R1, R2, compact) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
for (y, R1, R2, comp) in ((a, DefaultRefType, UInt8, true),
(a, DefaultRefType, DefaultRefType, false),
(x, R, UInt8, true),
(x, R, R, false))
x2 = categorical(y, ordered=ordered)
@test x2 == y
@test isa(x2, NullableCategoricalMatrix{String, R1})
@test isordered(x2) === ordered

x2 = categorical(y, compact, ordered=ordered)
x2 = categorical(y, comp, ordered=ordered)
@test x2 == y
@test isa(x2, NullableCategoricalMatrix{String, R2})
@test isordered(x2) === ordered
Expand Down

0 comments on commit eb63e31

Please sign in to comment.