From b7d75d0e988ca7163eab341c2c0f856266e1190e Mon Sep 17 00:00:00 2001 From: Aaron Kaw Date: Wed, 4 Sep 2024 08:50:34 +1000 Subject: [PATCH] Added tests to check if function inputs to derivative behave as expected --- test/diff.jl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/diff.jl b/test/diff.jl index 88956f138..23d9e837f 100644 --- a/test/diff.jl +++ b/test/diff.jl @@ -378,4 +378,15 @@ let Dt = Differential(t)^0 @test isequal(Dt, identity) test_equal(Dt(t + 2t^2), t + 2t^2) -end \ No newline at end of file +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