summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-22 04:16:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-22 04:16:21 +0000
commitff3288fe5a9ec1cd69eeb57b84ced7ac6eb8f16e (patch)
tree0f9fa2d73f521ec43808a327d33c53d531bbf25d /test
parent66e41cbe4f5dc0c8f499e74bd4553b15ebf1f20b (diff)
dir.c: glob brace expansion [Fix GH-1061]
* dir.c (ruby_brace_expand): glob brace expansion edge case fix. When there are closing braces '}' before a open brace '{' it must be ignored and considered as literal. [ruby-core:71138] [Bug #11609] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_dir.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index d7a09c65d8..510cbf3104 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -150,6 +150,11 @@ class TestDir < Test::Unit::TestCase
assert_equal([File.join(@root, "a")], Dir.glob(File.join(@root, 'a\\')))
assert_equal(("a".."f").map {|f| File.join(@root, f) }.sort, Dir.glob(File.join(@root, '[abc/def]')).sort)
+
+ open(File.join(@root, "}}{}"), "wb") {}
+ open(File.join(@root, "}}a"), "wb") {}
+ assert_equal(%w(}}{} }}a).map {|f| File.join(@root, f)}, Dir.glob(File.join(@root, '}}{\{\},a}')))
+ assert_equal(%w(}}{} }}a b c).map {|f| File.join(@root, f)}, Dir.glob(File.join(@root, '{\}\}{\{\},a},b,c}')))
end
def test_glob_recursive