summaryrefslogtreecommitdiff
path: root/test/ruby/test_fnmatch.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-25 09:32:47 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-25 09:32:47 +0000
commita0b3e032020b77898cbc4be04559456a3cb6f10b (patch)
tree870ee7c127a2673b036e84cc42ef4a760ec80f0b /test/ruby/test_fnmatch.rb
parent7b5a42f0fa54dbb0d381ffbe3b8de6601577c518 (diff)
* 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/trunk@40925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_fnmatch.rb')
-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 42f6a458f3..15e5d79e35 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