1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add the test of Dir.glob when sort: true is given explicitly

This commit is contained in:
Nobuyoshi Nakada 2021-11-05 10:20:02 +09:00
parent 1ce3706c58
commit f62f020f56
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -171,6 +171,8 @@ class TestDir < Test::Unit::TestCase
Dir.glob([@root, File.join(@root, "*")])) Dir.glob([@root, File.join(@root, "*")]))
assert_equal([@root] + ("a".."z").map {|f| File.join(@root, f) }, assert_equal([@root] + ("a".."z").map {|f| File.join(@root, f) },
Dir.glob([@root, File.join(@root, "*")], sort: false).sort) Dir.glob([@root, File.join(@root, "*")], sort: false).sort)
assert_equal([@root] + ("a".."z").map {|f| File.join(@root, f) },
Dir.glob([@root, File.join(@root, "*")], sort: true))
assert_raise_with_message(ArgumentError, /nul-separated/) do assert_raise_with_message(ArgumentError, /nul-separated/) do
Dir.glob(@root + "\0\0\0" + File.join(@root, "*")) Dir.glob(@root + "\0\0\0" + File.join(@root, "*"))
end end