diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-03 05:04:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-03 05:04:49 +0000 |
commit | 45df1c24d269f93a2bc1e7a6fe0ffcecc1193051 (patch) | |
tree | d761bfe41c93637d194b2a4fc2da9ed8080152e8 /test | |
parent | 3e2942423e38ab70738dd9aafdbbb06e834d3cc4 (diff) | |
download | ruby-45df1c24d269f93a2bc1e7a6fe0ffcecc1193051.tar.gz |
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')
-rw-r--r-- | test/ruby/test_dir.rb | 12 |
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"] |