Skip to content

Commit c7c2d88

Browse files
Merge pull request #88 from jpfairbanks/test_pr84
add regression test for PR #84
2 parents 8b7b7ae + 263e2df commit c7c2d88

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/derivatives.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,19 @@ jac = ModelingToolkit.calculate_jacobian(sys)
4444
# Variable dependence checking in differentiation
4545
@Unknown a(t) b(a)
4646
@test D(b) Constant(0)
47+
48+
49+
# Regression test for PR #84
50+
let
51+
# Define some variables
52+
@Param t σ ρ β
53+
@Unknown x(t) y(t) z(t)
54+
55+
f(x,y,z) = z*x+y
56+
# This used to seg fault, now raises MethodError
57+
@test_throws MethodError Derivative(f, x, 1)
58+
@Deriv D'~t
59+
op = expand_derivatives(D(f(x,y,z)))
60+
op.args[1].args[2].name == :z
61+
op.args[1].args[2].diff.x.name == :t
62+
end

0 commit comments

Comments
 (0)