summaryrefslogtreecommitdiff
path: root/test/ruby/test_dir.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_dir.rb')
-rw-r--r--test/ruby/test_dir.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 6054b8f..b0d848c 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"]