From 04fa9eb8066951897b036f36764d54bdf0b83776 Mon Sep 17 00:00:00 2001 From: Alexander Adam Date: Tue, 28 Oct 2025 18:46:45 +0100 Subject: [PATCH] update test to check for UTF16LE fixes #52 --- test/irb/test_completion.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb index cebfa3261..22db60375 100644 --- a/test/irb/test_completion.rb +++ b/test/irb/test_completion.rb @@ -345,13 +345,10 @@ def test_regexp_completor_handles_encoding_errors_gracefully end def test_utf16_method_name_does_not_crash - if RUBY_ENGINE == 'truffleruby' - omit "TruffleRuby does not support UTF-16 methods." - end # Reproduces issue #52: https://github.com/ruby/irb/issues/52 - method_name = "test_utf16_method".encode(Encoding::UTF_16) test_obj = Object.new - test_obj.define_singleton_method(method_name) {} + + test_obj.define_singleton_method("test_utf16le_method".encode(Encoding::UTF_16LE)) {} test_bind = test_obj.instance_eval { binding } completor = IRB::RegexpCompletor.new @@ -360,7 +357,7 @@ def test_utf16_method_name_does_not_crash result = completor.completion_candidates('', 'test', '', bind: test_bind) end - assert_include result, "test_utf16_method" + assert_include result, "test_utf16le_method" end end end