Skip to content

Commit

Permalink
test no op convert DimArray
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Aug 31, 2023
1 parent 6854b4e commit 2144cb0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ da = @test_nowarn DimArray(a, dimz; refdims=refdimz, name=:test, metadata=ameta)
val(dims(da, 1)) |> typeof
da2 = DimArray(a2, dimz2; refdims=refdimz, name=:test2)

@testset "convert" begin
@test all(convert(DimArray{Float32}, da) .=== Float32.(da))
end

@testset "checkbounds" begin
@test checkbounds(Bool, da, X(2), Y(1)) == true
@test checkbounds(Bool, da, X(10), Y(1)) == false
Expand Down Expand Up @@ -357,9 +353,13 @@ end
end

@testset "convert" begin
# To Array
ac = convert(Array, da2)
@test ac isa Array{Int,2}
@test ac == a2
# To DimArray
@test all(convert(DimArray{Float32}, da) .=== Float32.(da))
@test convert(DimArray{eltype(da)}, da) === da
end

if VERSION > v"1.1-"
Expand Down

0 comments on commit 2144cb0

Please sign in to comment.