diff options
author | shirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-21 13:32:03 +0000 |
---|---|---|
committer | shirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-21 13:32:03 +0000 |
commit | 0f63d961169989a7f6dcf7c0487fe29da178a4d2 (patch) | |
tree | 9addd6552097d7b56b93354ba1e5ef9f0a3a2564 /test/ruby/test_dir.rb | |
parent | 638c96858274deb90b2b923477d6b9525e1ed065 (diff) |
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/trunk@67332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir.rb')
-rw-r--r-- | test/ruby/test_dir.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 51ea8e95e0..93ae3c3ed9 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) |