From 45df1c24d269f93a2bc1e7a6fe0ffcecc1193051 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 3 Feb 2015 05:04:49 +0000 Subject: 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 --- test/ruby/test_dir.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 6184f05..85fdd16 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"] -- cgit v1.1