diff --git a/test/primitive.jl b/test/primitive.jl index a0571b0..e00801a 100644 --- a/test/primitive.jl +++ b/test/primitive.jl @@ -50,6 +50,12 @@ end # end end +@testset "Multi-argument functions" begin + @test derivative(x -> 1 + 1/x, 1.0, Val(1))≈-1.0 rtol=1e-6 + @test derivative(x -> (x+1)/x, 1.0, Val(1))≈-1.0 rtol=1e-6 + @test derivative(x -> x/x, 1.0, Val(1))≈ 0.0 rtol=1e-6 +end + @testset "Corner cases" begin offenders = ( TaylorScalar(Inf, (1.0, 0.0, 0.0)),