Skip to content

Commit

Permalink
Test maketerm keeping array type when symtype is Array
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenszhu committed Aug 11, 2024
1 parent f0bd7e4 commit 8b52a80
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ end
@syms x::Int y::Int
new_expr = SymbolicUtils.maketerm(typeof(ref_expr), (+), [x, y], nothing)
@test symtype(new_expr) == Int64

# Check that the Array type does not get changed to AbstractArray
new_expr = SymbolicUtils.maketerm(
SymbolicUtils.BasicSymbolic{Vector{Float64}}, sin, [1.0, 2.0], nothing)
@test symtype(new_expr) == Vector{Float64}
end

toterm(t) = Term{symtype(t)}(operation(t), arguments(t))
Expand Down

0 comments on commit 8b52a80

Please sign in to comment.