Skip to content

Commit

Permalink
Test eltype on Tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Jun 11, 2024
1 parent e61db4f commit 8496281
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/Tensor_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
@test parent(copy(view(tensor, :i => 1))) isa Array
end

@testset "eltype" for T in [Bool, Int, Float64, Complex{Float64}]
tensor = Tensor(rand(T, 2), [:i])
@test eltype(tensor) == T
end

@testset "similar" begin
tensor = Tensor(zeros(2, 2, 2), (:i, :j, :k))

Expand Down

0 comments on commit 8496281

Please sign in to comment.