diff options
author | Nobuyoshi Nakada <[email protected]> | 2025-01-08 21:35:48 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2025-01-09 19:26:20 +0900 |
commit | dfe6b7c02efa3bc2f5426eb64107ac0ac45a66a4 (patch) | |
tree | ca5e3d3738e1bb644bb0b7480b9e2069e5ab47d1 /test/ruby/test_rubyoptions.rb | |
parent | d44a41d81423c2362af3dfc6d9f9f7c2f21038c1 (diff) |
[Bug #21018] Show invalid command line option more properly
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12538
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 931d0cf7aa..16e2932114 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -441,11 +441,15 @@ class TestRubyOptions < Test::Unit::TestCase assert_in_out_err(%W(-\r -e) + [""], "", [], []) - assert_in_out_err(%W(-\rx), "", [], /invalid option -[\r\n] \(-h will show valid options\) \(RuntimeError\)/) + assert_in_out_err(%W(-\rx), "", [], /invalid option -\\r \(-h will show valid options\) \(RuntimeError\)/) - assert_in_out_err(%W(-\x01), "", [], /invalid option -\x01 \(-h will show valid options\) \(RuntimeError\)/) + assert_in_out_err(%W(-\x01), "", [], /invalid option -\\x01 \(-h will show valid options\) \(RuntimeError\)/) assert_in_out_err(%w(-Z), "", [], /invalid option -Z \(-h will show valid options\) \(RuntimeError\)/) + + # On some platforms, langinfo returns ANSI_X3.4-1968 when LC_ALL=C and fall backs to UTF-8. + # Anyway only printable chars should be printed. + assert_in_out_err(%W(-\u{1f608}), "", [], /invalid option -(\\xf0|\u{1f608}) \(-h will show valid options\) \(RuntimeError\)/) end def test_rubyopt |