Skip to content

Commit

Permalink
test: add tests for fast_subsitute on function of array of symbolics
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Jan 9, 2025
1 parent 4c06584 commit c00f09f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,12 @@ end
test_nested_derivative = Dx(Dt(Dt(u)))
result = diff2term(Symbolics.value(test_nested_derivative))
@test typeof(result) === Symbolics.BasicSymbolic{Real}
end
end

@testset "`fast_substitute` inside array symbolics" begin
@variables x y z
@register_symbolic foo(a::AbstractArray, b)
ex = foo([x, y], z)
ex2 = Symbolics.fixpoint_sub(ex, Dict(y => 1.0, z => 2.0))
@test isequal(ex2, foo([x, 1.0], 2.0))
end

0 comments on commit c00f09f

Please sign in to comment.