Skip to content

Commit

Permalink
Added tests to check if function inputs to derivative behave as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
kapple19 committed Sep 3, 2024
1 parent 914c315 commit b7d75d0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/diff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,15 @@ let
Dt = Differential(t)^0
@test isequal(Dt, identity)
test_equal(Dt(t + 2t^2), t + 2t^2)
end
end

# Check `Function` inputs for derivative (#1085)
let
@variables x
@testset for f in [sqrt, sin, acos, exp, cis]
@test isequal(
Symbolics.derivative(f, x),
Symbolics.derivative(f(x), x)
)
end
end

0 comments on commit b7d75d0

Please sign in to comment.