Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp5VT committed Dec 8, 2023
1 parent e05d5ff commit 410a8df
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion NDTensors/src/lib/UnallocatedArrays/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,21 @@ using .NDTensorsTestUtils: devices_list
@test F2 isa UnallocatedFill
@test F2[1, 1, 1] == elt(6.0)
@test alloctype(F2) == alloctype(F)

#F2 .+= elt(2.0) ## This is broken
F2 = F2 .+ elt(2.0)
@test F2 isa UnallocatedFill
@test F2[1,1,1] == elt(8.0)
@test alloctype(F2) == alloctype(F)

F = UnallocatedFill(Fill(elt(2.0), (2,3)), dev(Matrix{elt}))
R = Z + F
@test R isa UnallocatedFill
@test alloctype(R) == alloctype(Z)

R = F + Z
@test R isa UnallocatedFill
@test alloctype(R) == alloctype(Z)
end

## TODO make other kron tests
Expand Down Expand Up @@ -146,7 +161,12 @@ using .NDTensorsTestUtils: devices_list
R = Z + Z
@test_broken R isa UnallocatedZeros
@test_broken alloctype(R) == alloctype(Z)
R = Z .+ eltype(Z)(2.0)
R = Z .+ elt(2.0)
@test_broken R isa UnallocatedFill

F = UnallocatedFill(Fill(elt(2),(2,3)), dev(Matrix{elt}))
R = F + F
@test_broken R isa UnallocatedFill

end
end

0 comments on commit 410a8df

Please sign in to comment.