Skip to content

Commit 7af1008

Browse files
committed
update test to check for UTF16LE
fixes #52
1 parent 7ea4489 commit 7af1008

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/irb/test_completion.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,10 @@ def test_regexp_completor_handles_encoding_errors_gracefully
345345
end
346346

347347
def test_utf16_method_name_does_not_crash
348-
if RUBY_ENGINE == 'truffleruby'
349-
omit "TruffleRuby does not support UTF-16 methods."
350-
end
351348
# Reproduces issue #52: https://github.com/ruby/irb/issues/52
352-
method_name = "test_utf16_method".encode(Encoding::UTF_16)
353349
test_obj = Object.new
354-
test_obj.define_singleton_method(method_name) {}
350+
351+
test_obj.define_singleton_method("test_utf16le_method".encode(Encoding::UTF_16LE)) {}
355352
test_bind = test_obj.instance_eval { binding }
356353

357354
completor = IRB::RegexpCompletor.new
@@ -360,7 +357,7 @@ def test_utf16_method_name_does_not_crash
360357
result = completor.completion_candidates('', 'test', '', bind: test_bind)
361358
end
362359

363-
assert_include result, "test_utf16_method"
360+
assert_include result, "test_utf16le_method"
364361
end
365362
end
366363
end

0 commit comments

Comments
 (0)