mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Windows simply causes an error to open invalid path
This commit is contained in:
parent
fc3e80cf6d
commit
dcb6a6ae3e
1 changed files with 19 additions and 1 deletions
|
@ -381,8 +381,14 @@ puts Tempfile.new('foo').path
|
||||||
t = Tempfile.open([TRAVERSAL_PATH, 'foo'])
|
t = Tempfile.open([TRAVERSAL_PATH, 'foo'])
|
||||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
assert_equal expect, actual
|
assert_equal expect, actual
|
||||||
|
rescue Errno::EINVAL
|
||||||
|
if /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
assert "ok"
|
||||||
|
else
|
||||||
|
raise $!
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
t.close!
|
t&.close!
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_new_traversal_dir
|
def test_new_traversal_dir
|
||||||
|
@ -390,6 +396,12 @@ puts Tempfile.new('foo').path
|
||||||
t = Tempfile.new(TRAVERSAL_PATH + 'foo')
|
t = Tempfile.new(TRAVERSAL_PATH + 'foo')
|
||||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
assert_equal expect, actual
|
assert_equal expect, actual
|
||||||
|
rescue Errno::EINVAL
|
||||||
|
if /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
assert "ok"
|
||||||
|
else
|
||||||
|
raise $!
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
t&.close!
|
t&.close!
|
||||||
end
|
end
|
||||||
|
@ -399,6 +411,12 @@ puts Tempfile.new('foo').path
|
||||||
t = Tempfile.create(TRAVERSAL_PATH + 'foo')
|
t = Tempfile.create(TRAVERSAL_PATH + 'foo')
|
||||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
assert_equal expect, actual
|
assert_equal expect, actual
|
||||||
|
rescue Errno::EINVAL
|
||||||
|
if /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
assert "ok"
|
||||||
|
else
|
||||||
|
raise $!
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
if t
|
if t
|
||||||
t.close
|
t.close
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue