summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-28 03:28:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-28 03:28:38 +0000
commitd1b82673bcf7e67c836f8f7f32a299ca81d10b47 (patch)
tree64a44eb37b48d798d378e80f7696e1441e667144 /test
parent8bf06cb9752273f8fa1c9e176bb5ba85381f22a5 (diff)
merge revision(s) 67332: [Backport #15649]
dir.c: fix Dir.glob starts with brace * dir.c (ruby_glob0): expand braces if a glob pattern starts with brace. [ruby-core:91728] [Bug #15649] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_dir.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 02b9c32202..5196c08f81 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -205,6 +205,14 @@ class TestDir < Test::Unit::TestCase
end
end
+ def test_glob_starts_with_brace
+ Dir.chdir(@root) do
+ bug15649 = '[ruby-core:91728] [Bug #15649]'
+ assert_equal(["#{@root}/a", "#{@root}/b"],
+ Dir.glob("{#{@root}/a,#{@root}/b}"), bug15649)
+ end
+ end
+
if Process.const_defined?(:RLIMIT_NOFILE)
def test_glob_too_may_open_files
assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}", chdir: @root)