diff options
author | aycabta <aycabta@gmail.com> | 2021-12-24 11:04:07 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-12-24 11:03:34 +0900 |
commit | ae770cc372cd475f66c8eedea583e8437f7ab92c (patch) | |
tree | fda3b2aac1d90e64e5c1d3af453bf2a623cc7b82 | |
parent | cf83ba1da777a9bfc26949afdeabf38e2789060d (diff) | |
download | ruby-ae770cc372cd475f66c8eedea583e8437f7ab92c.tar.gz |
[ruby/reline] Add encoding info to an assertion of editing line
https://github.com/ruby/reline/commit/22d9262d79
-rw-r--r-- | test/reline/helper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/reline/helper.rb b/test/reline/helper.rb index cd3783ddb8..66a21e0f27 100644 --- a/test/reline/helper.rb +++ b/test/reline/helper.rb @@ -85,9 +85,13 @@ class Reline::TestCase < Test::Unit::TestCase def assert_byte_pointer_size(expected) expected = convert_str(expected) byte_pointer = @line_editor.instance_variable_get(:@byte_pointer) + chunk = @line_editor.line.byteslice(0, byte_pointer) assert_equal( expected.bytesize, byte_pointer, - "<#{expected.inspect}> expected but was\n<#{@line_editor.line.byteslice(0, byte_pointer).inspect}>") + <<~EOM) + <#{expected.inspect} (#{expected.encoding.inspect})> expected but was + <#{chunk.inspect} (#{chunk.encoding.inspect})> in <Terminal #{Reline::GeneralIO.encoding.inspect}> + EOM end def assert_cursor(expected) |