diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-03 02:14:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-03 02:14:51 +0000 |
commit | 83a31e9e90b978d73cbcfa4c1b5e936bb395bafe (patch) | |
tree | 6333fe4b82ca513d3c33aebf183aec5086b5cef0 /test/ruby/test_dir.rb | |
parent | 432e6805e1b14bc374724ab9fd03559811b871fb (diff) | |
download | ruby-83a31e9e90b978d73cbcfa4c1b5e936bb395bafe.tar.gz |
dir.c: relax base option
* dir.c (dir_glob_options): relax base option. ignore when nil
or an empty string as :base option. [Feature #13056]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir.rb')
-rw-r--r-- | test/ruby/test_dir.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 9f8b8183dc..1c338030f3 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -206,6 +206,9 @@ class TestDir < Test::Unit::TestCase files = %w[a/foo.c c/bar.c] files.each {|n| File.write(File.join(@root, n), "")} assert_equal(files, Dir.glob("*/*.c", base: @root).sort) + assert_equal(files, Dir.chdir(@root) {Dir.glob("*/*.c", base: ".").sort}) + assert_equal(files, Dir.chdir(@root) {Dir.glob("*/*.c", base: "").sort}) + assert_equal(files, Dir.chdir(@root) {Dir.glob("*/*.c", base: nil).sort}) end def test_glob_base_dir |