From 22d9262d79ee31db985458b4f17623a85367fe57 Mon Sep 17 00:00:00 2001 From: aycabta Date: Fri, 24 Dec 2021 11:04:07 +0900 Subject: [PATCH] Add encoding info to an assertion of editing line --- 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 cd3783ddb8..66a21e0f27 100644 --- a/test/reline/helper.rb +++ b/test/reline/helper.rb @@ -85,9 +85,13 @@ def assert_line(expected) 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 + EOM end def assert_cursor(expected)