Skip to content

Commit a105ba9

Browse files
committed
only test behavour with PersistentDict if it is defined
1 parent c1c9cfc commit a105ba9

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

test/tangent_types/abstract_zero.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,15 @@ end
184184
@test zero_tangent((1.0, 2.0)) == Tangent{Tuple{Float64,Float64}}(0.0, 0.0)
185185

186186
@test ==(
187-
zero_tangent(Dict{Int, Float64}(1=>2.4)),
187+
zero_tangent(Dict{Int, Float64}(1 => 2.4)),
188188
Tangent{Dict{Int,Float64}}(Dict{Int, Float64}())
189189
)
190-
@test ==(
191-
zero_tangent(Base.PersistentDict(1=>2.4)),
192-
Tangent{Base.PersistentDict{Int,Float64}}(Dict{Int, Float64}())
193-
)
190+
if isdefined(Base, :PersistentDict)
191+
@test ==(
192+
zero_tangent(Base.PersistentDict(1 => 2.4)),
193+
Tangent{Base.PersistentDict{Int,Float64}}(Dict{Int, Float64}())
194+
)
195+
end
194196

195197

196198
# Higher order

0 commit comments

Comments
 (0)