Use BigInt when sorting filenames (#22)

This commit is contained in:
Alex Ling
2020-03-27 04:45:03 +00:00
parent 1a0c3d81ce
commit d58c83fbd8
2 changed files with 11 additions and 1 deletions

View File

@@ -25,4 +25,12 @@ describe "compare_alphanumerically" do
compare_alphanumerically a, b
}.should eq ary
end
# https://github.com/hkalexling/Mango/issues/22
it "handles numbers larger than Int32" do
ary = ["14410155591588.jpg", "21410155591588.png", "104410155591588.jpg"]
ary.reverse.sort {|a, b|
compare_alphanumerically a, b
}.should eq ary
end
end