diff options
| author | tomoya ishida <tomoyapenguin@gmail.com> | 2024-11-28 03:36:53 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-11-27 18:36:57 +0000 |
| commit | 33c6bbca222eacfd0635105666edf892091b8180 (patch) | |
| tree | e3bc4b4f6b603d869b9fba51169ac3b37583fe52 /test | |
| parent | 0af2eafc590d863568e8203312f415142608d48c (diff) | |
[ruby/reline] fix/omit test that fail in encoding=US_ASCII
(https://github.com/ruby/reline/pull/784)
https://github.com/ruby/reline/commit/a6d1ac54e6
Diffstat (limited to 'test')
| -rw-r--r-- | test/reline/test_key_stroke.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/reline/test_key_stroke.rb b/test/reline/test_key_stroke.rb index 98080845dc..8f5c767ca4 100644 --- a/test/reline/test_key_stroke.rb +++ b/test/reline/test_key_stroke.rb @@ -103,14 +103,18 @@ class Reline::KeyStroke::Test < Reline::TestCase stroke = Reline::KeyStroke.new(config, encoding) assert_equal(Reline::KeyStroke::UNMATCHED, stroke.match_status('da'.bytes)) assert_equal(Reline::KeyStroke::MATCHED, stroke.match_status("\eda".bytes)) - assert_equal(Reline::KeyStroke::UNMATCHED, stroke.match_status([32, 195, 164])) + assert_equal(Reline::KeyStroke::UNMATCHED, stroke.match_status(" \eda".bytes)) assert_equal(Reline::KeyStroke::MATCHED, stroke.match_status([195, 164])) end def test_multibyte_matching + begin + char = 'あ'.encode(encoding) + rescue Encoding::UndefinedConversionError + omit + end config = Reline::Config.new stroke = Reline::KeyStroke.new(config, encoding) - char = 'あ'.encode(encoding) key = Reline::Key.new(char.ord, char.ord, false) bytes = char.bytes assert_equal(Reline::KeyStroke::MATCHED, stroke.match_status(bytes)) |
