From 1bb514e9d95f3bd70212c1a2d3278a2100ef09d7 Mon Sep 17 00:00:00 2001 From: Jarrett Revels Date: Wed, 10 Jan 2018 11:11:18 -0500 Subject: [PATCH] add rem2pi test --- test/MiscTest.jl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/MiscTest.jl b/test/MiscTest.jl index 608f0b46..ab7950b9 100644 --- a/test/MiscTest.jl +++ b/test/MiscTest.jl @@ -136,6 +136,10 @@ for i in 1:3, j in 1:3 i != j && (@test h[i, j] ≈ 0.0) end +######## +# misc # +######## + # issue 267 @noinline f267(z, x) = x[1] z267 = ([(1, (2), [(3, (4, 5, [1, 2, (3, (4, 5), [5])]), (5))])]) @@ -145,4 +149,8 @@ let z = z267 @test ForwardDiff.hessian(h, [1.]) == zeros(1, 1) end -end +# issue #290 +@test ForwardDiff.derivative(x -> rem2pi(x, RoundUp), rand()) == 1 +@test ForwardDiff.derivative(x -> rem2pi(x, RoundDown), rand()) == 1 + +end # module