Skip to content

Commit 41999eb

Browse files
committed
Added test that demonstrates issue with non-standard number types
1 parent 2d905d4 commit 41999eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/PartialsTest.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ using Random
55
using ForwardDiff
66
using ForwardDiff: Partials
77

8+
include(joinpath(dirname(@__FILE__), "Furlongs.jl"))
9+
810
samerng() = MersenneTwister(1)
911

1012
@testset "Partials{$N,$T}" for N in (0, 3), T in (Int, Float32, Float64)
@@ -131,6 +133,10 @@ samerng() = MersenneTwister(1)
131133
@test ForwardDiff._mul_partials(ZEROS, ZEROS, NaN, Inf).values == ZEROS.values
132134
end
133135
end
136+
137+
@testset "non-standard numbers" begin # Will be fixed by changing single_seed to use oneunit rather than one
138+
@test_throws MethodError ForwardDiff.construct_seeds(ForwardDiff.Partials{3, Furlongs.Furlong{1, Float64}})
139+
end
134140
end
135141

136142
io = IOBuffer()

0 commit comments

Comments
 (0)