diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-12-26 13:42:56 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-12-26 13:42:56 +0900 |
| commit | 19c39e4cfaa467e69b9848c9c5496d7f50d39c7f (patch) | |
| tree | 169225880b90a78c79f2f1b20b7e68c01313acef /test/ruby | |
| parent | 037bffec071d53bb7a147e11cb34635ea2e7abb8 (diff) | |
[Bug #20984] ENV.inspect should be encoding aware
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12471
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_env.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb index 3b519e3b29..f6f7f7a59a 100644 --- a/test/ruby/test_env.rb +++ b/test/ruby/test_env.rb @@ -357,6 +357,13 @@ class TestEnv < Test::Unit::TestCase assert_equal(expected, s) end + def test_inspect_encoding + ENV.clear + key = "VAR\u{e5 e1 e2 e4 e3 101 3042}" + ENV[key] = "foo" + assert_equal(%{{"VAR\u{e5 e1 e2 e4 e3 101 3042}"=>"foo"}}, ENV.inspect) + end + def test_to_a ENV.clear ENV["foo"] = "bar" |
