Fix incorrect assumptions in Ruby li_std_set test
This commit is contained in:
parent
af859a1e2d
commit
8801ea3f11
1 changed files with 4 additions and 1 deletions
|
|
@ -57,7 +57,10 @@ s = LanguageSet.new
|
|||
s.insert([1,2])
|
||||
s.insert(1)
|
||||
s.insert("hello")
|
||||
s.to_a == [1,[1,2],'hello'] # sort order: s.sort {|a,b| a.hash <=> b.hash}
|
||||
#s.to_a == [1,[1,2],'hello'] # sort order: s.sort {|a,b| a.hash <=> b.hash}
|
||||
# Test above is flawed as LanguageSet sorts by each element's hash, so the order will change from one invocation to the next. Sort a conversion to array instead.
|
||||
sa = s.to_a.sort { |x, y| x.to_s <=> y.to_s }
|
||||
sa == [1,[1,2],'hello']
|
||||
|
||||
EOF
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue