Skip to content

Commit 5303a7a

Browse files
authored
Add Dict test whether key is updated on re-assignment (#52110)
Tests whether key is updated even if they are equal. Refs #52066
1 parent 9eb2770 commit 5303a7a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/dict.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,3 +1528,10 @@ Base.hash(::BadHash, ::UInt)=UInt(1)
15281528
d[BadHash(1)]=nothing
15291529
@test !(BadHash(2) in keys(d))
15301530
end
1531+
1532+
# Issue #52066
1533+
let d = Dict()
1534+
d[1] = 'a'
1535+
d[1.0] = 'b'
1536+
@test only(d) === Pair{Any,Any}(1.0, 'b')
1537+
end

0 commit comments

Comments
 (0)