summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-04 15:09:53 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-04 15:09:53 +0000
commit0c91b2493c566b407e1ce9a64ed1a367f353716f (patch)
treeb5cc03d64f470f30678286a5f40f32abe56994be /test
parent28b7866304e66f3f77b5515adc508bb8cb7283d0 (diff)
merge revision(s) 40925: [Backport #8451]
* dir.c (bracket): fix copy-paste error. When the first and last characters of fnmatch range have different length, fnmatch may have wrongly matched a path that does not really match. Coverity Scan found this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_fnmatch.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_fnmatch.rb b/test/ruby/test_fnmatch.rb
index 0b3f604df5..269d26e02f 100644
--- a/test/ruby/test_fnmatch.rb
+++ b/test/ruby/test_fnmatch.rb
@@ -124,4 +124,9 @@ class TestFnmatch < Test::Unit::TestCase
assert(File.fnmatch("{*,#{pattern_eucjp}}", path, File::FNM_EXTGLOB))
end
end
+
+ def test_unicode
+ assert_file.fnmatch("[a-\u3042]*", "\u3042")
+ assert_file.not_fnmatch("[a-\u3042]*", "\u3043")
+ end
end