aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_dir.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-03 22:12:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-03 22:12:24 +0000
commit9375ff5b06704b2fbad3f740cecf10399786acfd (patch)
tree6f9c935edf020670616d4f668e39d1433198adf1 /test/ruby/test_dir.rb
parent99487313fd5298feda5e083d757e967b1567998c (diff)
downloadruby-9375ff5b06704b2fbad3f740cecf10399786acfd.tar.gz
dir.c: FNM_SHORTNAME
* dir.c (dirent_match): match short names only when FNM_SHORTNAME flag is given, for the backward compatibility, and the new behavior is often dangerous. [ruby-core:69435] [Bug #11206] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir.rb')
-rw-r--r--test/ruby/test_dir.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 3b3c048d53..9e92286905 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -262,6 +262,7 @@ class TestDir < Test::Unit::TestCase
if /mswin|mingw/ =~ RUBY_PLATFORM
def test_glob_legacy_short_name
bug10819 = '[ruby-core:67954] [Bug #10819]'
+ bug11206 = '[ruby-core:69435] [Bug #11206]'
skip unless /\A\w:/ =~ ENV["ProgramFiles"]
short = "#$&/PROGRA~1"
skip unless File.directory?(short)
@@ -270,8 +271,9 @@ class TestDir < Test::Unit::TestCase
long = File.expand_path(short)
assert_equal(Dir.glob("#{long}/Common*"), entries, bug10819)
wild = short.sub(/1\z/, '*')
- assert_include(Dir.glob(wild), long, bug10819)
- assert_empty(entries - Dir.glob("#{wild}/Common*"), bug10819)
+ assert_not_include(Dir.glob(wild), long, bug11206)
+ assert_include(Dir.glob(wild, File::FNM_SHORTNAME), long, bug10819)
+ assert_empty(entries - Dir.glob("#{wild}/Common*", File::FNM_SHORTNAME), bug10819)
end
end