Fix incorrect assumptions in Ruby li_std_set test

This commit is contained in:
William S Fulton 2013-03-31 00:21:12 +00:00
commit 8801ea3f11

View file

@ -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