Skip to content

Commit 43ee7d8

Browse files
authored
fix tests on v0.6 (#172)
1 parent b0730bf commit 43ee7d8

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/deprecated.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Base.@deprecate HessianResult(x) DiffBase.HessianResult(x)
1616

1717
immutable Chunk{N}
1818
function Chunk()
19-
Base.depwarn("Chunk{N}() is deprecated, use the ForwardDiff.Config API instead.", :Chunk)
19+
Base.depwarn("Chunk{N}() is deprecated, use the ForwardDiff.AbstractConfig API instead.", :Chunk)
2020
return new()
2121
end
2222
end

test/DualTest.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ if v"0.4" <= VERSION < v"0.5"
2020
Base.hypot(x, y, z) = hypot(hypot(x, y), z)
2121
end
2222

23+
test_approx_diffnums(a::Real, b::Real) = @test_approx_eq a b
24+
25+
function test_approx_diffnums{N}(a::Dual{N}, b::Dual{N})
26+
test_approx_diffnums(value(a), value(b))
27+
for i in 1:N
28+
test_approx_diffnums(partials(a)[i], partials(b)[i])
29+
end
30+
end
31+
2332
for N in (0,3), M in (0,4), T in (Int, Float32)
2433
println(" ...testing Dual{$N,$T} and Dual{$N,Dual{$M,$T}}")
2534

@@ -306,15 +315,6 @@ for N in (0,3), M in (0,4), T in (Int, Float32)
306315
# Math #
307316
########
308317

309-
test_approx_diffnums(a::Real, b::Real) = @test_approx_eq a b
310-
311-
function test_approx_diffnums{N}(a::Dual{N}, b::Dual{N})
312-
test_approx_diffnums(value(a), value(b))
313-
for i in 1:N
314-
test_approx_diffnums(partials(a)[i], partials(b)[i])
315-
end
316-
end
317-
318318
# Arithmetic #
319319
#------------#
320320

0 commit comments

Comments
 (0)