Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions test/irb/test_completion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Loading