Add Dir.home test with encoding

This commit is contained in:
Nobuyoshi Nakada 2022-12-23 18:55:29 +09:00
parent d6ce4180a5
commit 6a55b4601a
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -544,6 +544,16 @@ class TestDir < Test::Unit::TestCase
end
end
if Encoding.find("filesystem") == Encoding::UTF_8
# On Windows and macOS, file system encoding is always UTF-8.
def test_home_utf8
setup_envs
ENV["HOME"] = "/\u{e4}~\u{1f3e0}"
assert_equal("/\u{e4}~\u{1f3e0}", Dir.home)
end
end
def test_symlinks_not_resolved
Dir.mktmpdir do |dirname|
Dir.chdir(dirname) do