summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-04-05 20:35:34 +0900
committernagachika <nagachika@ruby-lang.org>2021-04-05 20:48:25 +0900
commit59cfa0b1346067e36ae11fc6c317693ce4b9833a (patch)
tree021b265720b501f26e9b134289949d4f04abfe48 /test
parentb59e5a64be40b93370afbb0accfcb73c4d682045 (diff)
Backport a tmpdir fix.
Remove other then alphanumeric and some punctuations considered filesystem-safe, instead of removing some unsafe chars only.
Diffstat (limited to 'test')
-rw-r--r--test/test_tmpdir.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test_tmpdir.rb b/test/test_tmpdir.rb
index 50583b5ce1..ea2cc123c1 100644
--- a/test/test_tmpdir.rb
+++ b/test/test_tmpdir.rb
@@ -86,6 +86,10 @@ class TestTmpdir < Test::Unit::TestCase
traversal_path = Array.new(target.count('/')-2, '..').join('/') + traversal_path
actual = yield traversal_path
assert_not_send([File.absolute_path(actual), :start_with?, target])
+ [File::SEPARATOR, File::ALT_SEPARATOR].compact.each do |separator|
+ actual = yield traversal_path.tr('/', separator)
+ assert_not_send([File.absolute_path(actual), :start_with?, target])
+ end
end
end
end