diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-21 14:07:54 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-21 14:09:12 +0900 |
commit | 502ca37dde288d20fed6e6ea34f4ab3299de7777 (patch) | |
tree | cad3f61822ef1b31e72e6d83b6885c8f32671dfc /test/optparse/test_optparse.rb | |
parent | afd46429fcdb83aa9fa7c193ede40bff3f3ff151 (diff) | |
download | ruby-502ca37dde288d20fed6e6ea34f4ab3299de7777.tar.gz |
[ruby/optparse] The encoding argument of `Regexp.new` has been ignored since 1.9
https://github.com/ruby/optparse/commit/766f567405
Diffstat (limited to 'test/optparse/test_optparse.rb')
-rw-r--r-- | test/optparse/test_optparse.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/optparse/test_optparse.rb b/test/optparse/test_optparse.rb index 5a0593d9bb..bfa705ad03 100644 --- a/test/optparse/test_optparse.rb +++ b/test/optparse/test_optparse.rb @@ -63,6 +63,9 @@ class TestOptionParser < Test::Unit::TestCase assert_equal(/foo/i, @reopt) assert_equal(%w"", no_error {@opt.parse!(%w"--regexp=/foo/n")}) assert_equal(/foo/n, @reopt) + assert_equal(%w"", no_error {@opt.parse!(%W"--regexp=/\u{3042}/s")}) + assert_equal(Encoding::Windows_31J, @reopt.encoding) + assert_equal("\x82\xa0".force_encoding(Encoding::Windows_31J), @reopt.source) end def test_into |