Skip to content

Commit

Permalink
Merge pull request #12 from jamesgardner1421/fix-testing
Browse files Browse the repository at this point in the history
Fix isapprox for dictionaries in testing (and highlight existing errors)
  • Loading branch information
jameskermode authored Aug 20, 2021
2 parents c429edb + 68b9a2b commit 581116e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ function Base.isapprox(seq1::AbstractDict, seq2::AbstractDict)
for (k1,v1) in seq1
k1 keys(seq2) || (println("key $k1 missing from seq2"); return false)
if v1 isa AbstractDict
return isapprox(v1, seq2[k1])
elseif v1 isa Array{AbstractFloat} || v1 isa AbstractFloat
v1 seq2[k1] || (println("key $k1: $v1 !≈ $(seq2[k1])"); return false)
elseif v1 isa Array{<:AbstractFloat} || v1 isa AbstractFloat
v1 seq2[k1] || (println("key $k1: $v1 !≈ $(seq2[k1])"); return false)
else
v1 == seq2[k1] || (println("key $k1: $v1 != $(seq2[k1])"); return false)
Expand Down

0 comments on commit 581116e

Please sign in to comment.