Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Jun 19, 2020
1 parent 851798e commit da0ddba
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/11_array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -650,4 +650,23 @@ end
@test unique(x) == collect(1:10)
end

@testset "repeat" begin
for o in (false, true), c in (false, true),
a in [["b", "a", "b"], ["b" "a"; "b" "c"]], i in 0:2
x = categorical(a, ordered=o, compress=c)
xr = repeat(x, i)
@test eltype(x) == eltype(xr)
@test isordered(x) == isordered(xr)
@test xr == categorical(repeat(a, i), ordered=o, compress=c)
for j in 0:2
ir = ntuple(x -> i, ndims(a))
or = ntuple(x -> j, ndims(a))
xr = repeat(x, inner=ir, outer=or)
@test eltype(x) == eltype(xr)
@test isordered(x) == isordered(xr)
@test xr == categorical(repeat(a, inner=ir, outer=or), ordered=o, compress=c)
end
end
end

end

0 comments on commit da0ddba

Please sign in to comment.