Skip to content

Commit 2e003ee

Browse files
committed
fix test
1 parent 1b1697a commit 2e003ee

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/forwarddiff_overloads.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ krylov_u0_sol = solve(krylov_prob, KrylovJL_GMRES())
2424

2525
@test (krylov_u0_sol, backslash_x_p, rtol = 1e-9)
2626

27-
2827
A, _ = h([ForwardDiff.Dual(5.0, 1.0, 0.0), ForwardDiff.Dual(5.0, 0.0, 1.0)])
2928
backslash_x_p = A \ [6.0, 10.0, 25.0]
3029
prob = LinearProblem(A, [6.0, 10.0, 25.0])
3130

32-
@test (solve(prob).u, backslash_x_p, rtol = 1e-9)
31+
@test (solve(prob).u, backslash_x_p, rtol = 1e-9)
3332
@test (solve(prob, KrylovJL_GMRES()).u, backslash_x_p, rtol = 1e-9)
3433

3534
_, b = h([ForwardDiff.Dual(5.0, 1.0, 0.0), ForwardDiff.Dual(5.0, 0.0, 1.0)])
@@ -117,7 +116,6 @@ cache.b = new_b
117116
@test cache.A == new_A
118117
@test cache.b == new_b
119118

120-
121119
function linprob_f(p)
122120
A, b = h(p)
123121
prob = LinearProblem(A, b)
@@ -129,7 +127,8 @@ function slash_f(p)
129127
A \ b
130128
end
131129

132-
@test (ForwardDiff.jacobian(slash_f, [5.0, 5.0]), ForwardDiff.jacobian(linprob_f, [5.0, 5.0]))
130+
@test (
131+
ForwardDiff.jacobian(slash_f, [5.0, 5.0]), ForwardDiff.jacobian(linprob_f, [5.0, 5.0]))
133132

134133
@test (ForwardDiff.jacobian(p -> ForwardDiff.jacobian(slash_f, [5.0, p[1]]), [5.0]),
135134
ForwardDiff.jacobian(p -> ForwardDiff.jacobian(linprob_f, [5.0, p[1]]), [5.0]))
@@ -157,8 +156,8 @@ end
157156
@test (ForwardDiff.hessian(slash_f_hes, [5.0]),
158157
ForwardDiff.hessian(linprob_f_hes, [5.0]))
159158

160-
161159
# Test aliasing
160+
A, b = h([ForwardDiff.Dual(5.0, 1.0, 0.0), ForwardDiff.Dual(5.0, 0.0, 1.0)])
162161

163162
prob = LinearProblem(A, b)
164163
cache = init(prob)
@@ -175,7 +174,6 @@ backslash_x_p = new_A \ new_b
175174

176175
@test linu == cache.u
177176

178-
179177
# Test Float Only solvers
180178

181179
A, b = h([ForwardDiff.Dual(5.0, 1.0, 0.0), ForwardDiff.Dual(5.0, 0.0, 1.0)])

0 commit comments

Comments
 (0)