Skip to content

Commit

Permalink
Add tests for cat
Browse files Browse the repository at this point in the history
  • Loading branch information
felixcremer authored and rafaqz committed Jan 21, 2024
1 parent 245ff09 commit ada19c1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,20 @@ end
@test collect(cat(collect(a), b; dims=1)) == cat(collect(a), collect(b); dims=1)
end

@testset "cat with 1-Tuple dimension" begin
@test cat(a, b; dims=(1,)) isa DiskArrays.ConcatDiskArray
@test cat(a, b; dims=(1,)) == cat(a, b; dims=1)
@test collect(cat(a, b; dims=(1,))) == cat(collect(a), collect(b); dims=(1,))
@test collect(cat(a, b; dims=(2,))) == cat(collect(a), collect(b); dims=(2,))
@test collect(cat(a, b; dims=(3,))) == cat(collect(a), collect(b); dims=(3,))
@test collect(cat(a, b; dims=(4,))) == cat(collect(a), collect(b); dims=(4,))
@test collect(cat(a, b; dims=(5,))) == cat(collect(a), collect(b); dims=(5,))
end

@testset "cat with 2-tuple" begin
@test_throws ArgumentError cat(a,b, dims=(1,2))
end

@testset "write concat" begin
ca .= reshape(0:23, 4, 6)
@test sum(ca) == sum(0:23)
Expand Down

0 comments on commit ada19c1

Please sign in to comment.