Skip to content

Commit

Permalink
test: simpler promote_to testing
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Nov 8, 2024
1 parent e4d6956 commit b7a3fa6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,14 @@ end
x_concrete = Reactant.to_rarray(x)
@test @jit(abs.(x_concrete)) abs.(x)
end

@testset "promote_to Complex" begin
x = 1.0 + 2.0im
y = Reactant.ConcreteRNumber(x)

f = Reactant.compile((y,)) do z
z + Reactant.promote_to(Reactant.TracedRNumber{ComplexF64}, 1.0 - 3.0im)
end

@test isapprox(f(y), 2.0 - 1.0im)
end

0 comments on commit b7a3fa6

Please sign in to comment.