1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Ignore invalid 3 colons in completion

https://github.com/ruby/irb/commit/5e29e3e39c
This commit is contained in:
aycabta 2021-09-11 04:30:29 +09:00 committed by git
parent cfbf2bde40
commit 3e038ab1c7
2 changed files with 6 additions and 1 deletions

View file

@ -286,7 +286,7 @@ module IRB
all_gvars.grep(Regexp.new(Regexp.quote(gvar)))
end
when /^([^."].*)(\.|::)([^.]*)$/
when /^([^.:"].*)(\.|::)([^.]*)$/
# variable.func or func.func
receiver = $1
sep = $2

View file

@ -32,6 +32,11 @@ module TestIRB
assert_empty(IRB::InputCompletor.retrieve_completion_data(":irb_unknown_symbol_abcdefg", bind: binding))
end
def test_complete_invalid_three_colons
assert_empty(IRB::InputCompletor.retrieve_completion_data(":::A", bind: binding))
assert_empty(IRB::InputCompletor.retrieve_completion_data(":::", bind: binding))
end
def test_complete_symbol_failure
assert_nil(IRB::InputCompletor::PerfectMatchedProc.(":aiueo", bind: binding))
end