diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_dir.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 6054b8f7fe..b0d848c83f 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -228,6 +228,27 @@ class TestDir < Test::Unit::TestCase assert_empty(Dir.glob(File.join(@root, "<")), bug8597) end + def test_glob_cases + feature5994 = "[ruby-core:42469] [Feature #5994]" + feature5994 << "\nDir.glob should return the filename with actual cases on the filesystem" + Dir.chdir(File.join(@root, "a")) do + open("FileWithCases", "w") {} + return unless File.exist?("filewithcases") + assert_equal(%w"FileWithCases", Dir.glob("filewithcases"), feature5994) + end + Dir.chdir(File.join(@root, "c")) do + open("FileWithCases", "w") {} + mode = File.stat(".").mode + begin + File.chmod(mode & ~0444, ".") + return if mode == File.stat(".").mode + assert_equal(%w"filewithcases", Dir.glob("filewithcases"), feature5994) + ensure + File.chmod(mode, ".") + end + end + end + def test_home env_home = ENV["HOME"] env_logdir = ENV["LOGDIR"] |