Skip to content

Commit

Permalink
add regression test for PR SciML#84
Browse files Browse the repository at this point in the history
closes SciML#82
  • Loading branch information
jpfairbanks committed Jan 15, 2019
1 parent 8b7b7ae commit 263e2df
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/derivatives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,19 @@ jac = ModelingToolkit.calculate_jacobian(sys)
# Variable dependence checking in differentiation
@Unknown a(t) b(a)
@test D(b) Constant(0)


# Regression test for PR #84
let
# Define some variables
@Param t σ ρ β
@Unknown x(t) y(t) z(t)

f(x,y,z) = z*x+y
# This used to seg fault, now raises MethodError
@test_throws MethodError Derivative(f, x, 1)
@Deriv D'~t
op = expand_derivatives(D(f(x,y,z)))
op.args[1].args[2].name == :z
op.args[1].args[2].diff.x.name == :t
end

0 comments on commit 263e2df

Please sign in to comment.