mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-25 00:00:52 -04:00
Break util.cr into multiple files
This commit is contained in:
+5
-5
@@ -1,10 +1,10 @@
|
||||
require "./spec_helper"
|
||||
|
||||
describe "compare_alphanumerically" do
|
||||
describe "compare_numerically" do
|
||||
it "sorts filenames with leading zeros correctly" do
|
||||
ary = ["010.jpg", "001.jpg", "002.png"]
|
||||
ary.sort! { |a, b|
|
||||
compare_alphanumerically a, b
|
||||
compare_numerically a, b
|
||||
}
|
||||
ary.should eq ["001.jpg", "002.png", "010.jpg"]
|
||||
end
|
||||
@@ -12,7 +12,7 @@ describe "compare_alphanumerically" do
|
||||
it "sorts filenames without leading zeros correctly" do
|
||||
ary = ["10.jpg", "1.jpg", "0.png", "0100.jpg"]
|
||||
ary.sort! { |a, b|
|
||||
compare_alphanumerically a, b
|
||||
compare_numerically a, b
|
||||
}
|
||||
ary.should eq ["0.png", "1.jpg", "10.jpg", "0100.jpg"]
|
||||
end
|
||||
@@ -22,7 +22,7 @@ describe "compare_alphanumerically" do
|
||||
ary = ["2", "12", "200000", "1000000", "a", "a12", "b2", "text2",
|
||||
"text2a", "text2a2", "text2a12", "text2ab", "text12", "text12a"]
|
||||
ary.reverse.sort { |a, b|
|
||||
compare_alphanumerically a, b
|
||||
compare_numerically a, b
|
||||
}.should eq ary
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@ describe "compare_alphanumerically" do
|
||||
it "handles numbers larger than Int32" do
|
||||
ary = ["14410155591588.jpg", "21410155591588.png", "104410155591588.jpg"]
|
||||
ary.reverse.sort { |a, b|
|
||||
compare_alphanumerically a, b
|
||||
compare_numerically a, b
|
||||
}.should eq ary
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user