summaryrefslogtreecommitdiff
path: root/test/ruby/test_dir.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-03 03:39:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-03 03:39:33 +0000
commit1ef613dd0b6db1a3df63224803eadd2911ab427d (patch)
tree1fd99d8e21f3b48831b5fd77bfdc420f78eece8e /test/ruby/test_dir.rb
parent6c676acfa258e85a0ea2f0c7941446568a78d828 (diff)
dir.c: relative path Dir base
* dir.c (glob_helper): fix globbing based on a relative path Dir. [Feature #13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir.rb')
-rw-r--r--test/ruby/test_dir.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 1c338030f31..5a2529ca97e 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -207,6 +207,7 @@ class TestDir < Test::Unit::TestCase
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(%w[foo.c], Dir.chdir(@root) {Dir.glob("*.c", base: "a").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
@@ -215,6 +216,7 @@ 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.open(@root) {|d| Dir.glob("*/*.c", base: d)}.sort)
+ assert_equal(%w[foo.c], Dir.chdir(@root) {Dir.open("a") {|d| Dir.glob("*", base: d)}})
end
def assert_entries(entries, children = false)