summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-03 05:04:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-03 05:04:49 +0000
commit45df1c24d269f93a2bc1e7a6fe0ffcecc1193051 (patch)
treed761bfe41c93637d194b2a4fc2da9ed8080152e8 /test/ruby
parent3e2942423e38ab70738dd9aafdbbb06e834d3cc4 (diff)
dir.c: glob legacy short name
* dir.c (glob_helper): obtain real name with FindFirstFile API instead of matchin all entries, on Windows. [ruby-core:67954] [Bug #10819] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_dir.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 6184f05edb..85fdd16dfd 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -248,6 +248,18 @@ class TestDir < Test::Unit::TestCase
assert_equal(roots.map {|n| "/..#{n}"}, Dir.glob("/../*"), bug9648)
end
+ if /mswin|mingw/ =~ RUBY_PLATFORM
+ def test_glob_legacy_short_name
+ bug10819 = '[ruby-core:67954] [Bug #10819]'
+ skip unless /\A\w:/ =~ ENV["ProgramFiles"]
+ short = "#$&/PROGRA~1"
+ skip unless File.directory?(short)
+ entries = Dir.glob("#{short}/Common*")
+ assert_not_empty(entries, bug10819)
+ assert_equal(Dir.glob("#{File.expand_path(short)}/Common*"), entries, bug10819)
+ end
+ end
+
def test_home
env_home = ENV["HOME"]
env_logdir = ENV["LOGDIR"]