Issue #7182 has been reported by nazomikan ( ??????).

----------------------------------------
Bug #7182: bug with Array#sort ?
https://bugs.ruby-lang.org/issues/7182

Author: nazomikan ( ??????)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 1.9.2
ruby -v: 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]


Array.sort???????????????????????????????????( p ary.sort do |a,b| .. end )???????????????????????件???????????????????????????

# case 1
ary = ["1", "2", "10", "11", "3", "4", "23"]
p ary.sort
# result: ["1", "10", "11", "2", "23", "3", "4"]


#case 2
ary = ["1", "2", "10", "11", "3", "4", "23"]
p ary.sort do |a, b|
  a.to_i <=> b.to_i
end
# result: ["1", "10", "11", "2", "23", "3", "4"]


#case 3
ary = ["1", "2", "10", "11", "3", "4", "23"]
p ary.sort! do |a, b|
  a.to_i <=> b.to_i
end
# result: ["1", "10", "11", "2", "23", "3", "4"]


#case 4
ary = ["1", "2", "10", "11", "3", "4", "23"]
ary.sort! do |a, b|
  a.to_i <=> b.to_i
end
p ary
# result: ["1", "2", "3", "4", "10", "11", "23"]


#case 5
ary = ["1", "2", "10", "11", "3", "4", "23"]
ary2 = ary.sort do |a, b|
  a.to_i <=> b.to_i
end
p ary2
# result: ["1", "2", "3", "4", "10", "11", "23"]


#case 6
ary = ["1", "2", "10", "11", "3", "4", "23"]
p ary.sort do |a, b|
  a.to_i <=> b.to_i
end
# result: ["1", "10", "11", "2", "23", "3", "4"]



-- 
http://bugs.ruby-lang.org/