diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2020-06-22 17:07:49 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2020-06-22 17:11:24 +0900 |
commit | d231b8f95b35d8a344cec4f62d7bbdf360a70e1c (patch) | |
tree | 37b46c5923d09583207eff110889bf739c0c70bc /test/fileutils | |
parent | 48d7ebe6fc7dec0856498ddb93695c3797ae0101 (diff) |
Fix remove_entry error when path encoding is not compatible UTF-8
Diffstat (limited to 'test/fileutils')
-rw-r--r-- | test/fileutils/test_fileutils.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index a72cb6bc96..8a546ccf1b 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -756,6 +756,23 @@ class TestFileUtils < Test::Unit::TestCase assert_file_not_exist dir end + def test_remove_entry_multibyte_path + c = "\u00a7" + begin + c = c.encode('filesystem') + rescue EncodingError + c = c.b + end + dir = "tmpdir#{c}" + my_rm_rf dir + + Dir.mkdir dir + File.write("#{dir}/#{c}.txt", "test_remove_entry_multibyte_path") + + remove_entry dir + assert_file_not_exist dir + end + def test_remove_entry_secure check_singleton :remove_entry_secure |