[前][次][番号順一覧][スレッド一覧]

ruby-changes:70503

From: aycabta <ko1@a...>
Date: Fri, 24 Dec 2021 11:03:49 +0900 (JST)
Subject: [ruby-changes:70503] ae770cc372 (master): [ruby/reline] Add encoding info to an assertion of editing line

https://git.ruby-lang.org/ruby.git/commit/?id=ae770cc372

From ae770cc372cd475f66c8eedea583e8437f7ab92c Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Fri, 24 Dec 2021 11:04:07 +0900
Subject: [ruby/reline] Add encoding info to an assertion of editing line

https://github.com/ruby/reline/commit/22d9262d79
---
 test/reline/helper.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/reline/helper.rb b/test/reline/helper.rb
index cd3783ddb86..66a21e0f27d 100644
--- a/test/reline/helper.rb
+++ b/test/reline/helper.rb
@@ -85,9 +85,13 @@ class Reline::TestCase < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/reline/helper.rb#L85
   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)
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]