Skip to content

Commit

Permalink
Fix Set rehash! test
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Jun 27, 2015
1 parent f36ccf0 commit 425ad1b
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions test/sets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,23 @@ s = Set([1])
@test isequal(empty!(s), Set())

# rehash!
s = Set(1:5)
k = s.dict.keys
Base.rehash!(s)
@test !isequal(s.dict.keys, k)
let
# Use a pointer type to have defined behavior for uninitialized
# array element
s = Set(["a", "b", "c"])
Base.rehash!(s)
k = s.dict.keys
Base.rehash!(s)
@test length(k) == length(s.dict.keys)
for i in 1:length(k)
if isdefined(k, i)
@test k[i] == s.dict.keys[i]
else
@test !isdefined(s.dict.keys, i)
end
end
s == Set(["a", "b", "c"])
end

# start, done, next
for data_in in ((7,8,4,5),
Expand Down

0 comments on commit 425ad1b

Please sign in to comment.