diff --git a/test/11_array.jl b/test/11_array.jl index a35ff89a..9b38ce93 100644 --- a/test/11_array.jl +++ b/test/11_array.jl @@ -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