diff options
author | Yusuke Endoh <[email protected]> | 2024-10-10 11:48:06 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2024-10-10 12:23:18 +0900 |
commit | a985695b9e7f58552cfa6b8700c4dabc137e41e8 (patch) | |
tree | 79b6ad10fe931cb4d7253cda52d8e153db89aec0 | |
parent | 51fdd2c6ca1c96740cb202770c559acb791b3f12 (diff) |
Make test_hash_symbol_colon_key pass on LANG=en_US
It failed on a platform with LANG=en_US
```
1) Failure:
PPTestModule::PPSingleLineTest#test_hash_symbol_colon_key [/home/chkbuild/chkbuild/tmp/build/20241010T010005Z/ruby/test/test_pp.rb:207]:
<"{a: 1, a!: 1, a?: 1, \u3042: 1}"> expected but was
<"{a: 1, a!: 1, a?: 1, \"\\u3042\": 1}">.
```
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11862
-rw-r--r-- | test/test_pp.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test_pp.rb b/test/test_pp.rb index 57a3876854..e650fca4bc 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -199,12 +199,14 @@ class PPSingleLineTest < Test::Unit::TestCase def test_hash_symbol_colon_key omit if RUBY_VERSION < "3.4." - no_quote = "{a: 1, a!: 1, a?: 1, \u{3042}: 1}" + no_quote = "{a: 1, a!: 1, a?: 1}" + unicode_quote = "{\u{3042}: 1}" quote0 = '{"": 1}' quote1 = '{"0": 1, "!": 1, "%": 1, "&": 1, "*": 1, "+": 1, "-": 1, "/": 1, "<": 1, ">": 1, "^": 1, "`": 1, "|": 1, "~": 1}' quote2 = '{"@a": 1, "$a": 1, "+@": 1, "a=": 1, "[]": 1}' quote3 = '{"a\"b": 1, "@@a": 1, "<=>": 1, "===": 1, "[]=": 1}' assert_equal(no_quote, PP.singleline_pp(eval(no_quote), ''.dup)) + assert_equal({ "\u3042": 1 }.inspect, PP.singleline_pp(eval(unicode_quote), ''.dup)) assert_equal(quote0, PP.singleline_pp(eval(quote0), ''.dup)) assert_equal(quote1, PP.singleline_pp(eval(quote1), ''.dup)) assert_equal(quote2, PP.singleline_pp(eval(quote2), ''.dup)) |