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:
parent
cfbf2bde40
commit
3e038ab1c7
2 changed files with 6 additions and 1 deletions
|
@ -286,7 +286,7 @@ module IRB
|
||||||
all_gvars.grep(Regexp.new(Regexp.quote(gvar)))
|
all_gvars.grep(Regexp.new(Regexp.quote(gvar)))
|
||||||
end
|
end
|
||||||
|
|
||||||
when /^([^."].*)(\.|::)([^.]*)$/
|
when /^([^.:"].*)(\.|::)([^.]*)$/
|
||||||
# variable.func or func.func
|
# variable.func or func.func
|
||||||
receiver = $1
|
receiver = $1
|
||||||
sep = $2
|
sep = $2
|
||||||
|
|
|
@ -32,6 +32,11 @@ module TestIRB
|
||||||
assert_empty(IRB::InputCompletor.retrieve_completion_data(":irb_unknown_symbol_abcdefg", bind: binding))
|
assert_empty(IRB::InputCompletor.retrieve_completion_data(":irb_unknown_symbol_abcdefg", bind: binding))
|
||||||
end
|
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
|
def test_complete_symbol_failure
|
||||||
assert_nil(IRB::InputCompletor::PerfectMatchedProc.(":aiueo", bind: binding))
|
assert_nil(IRB::InputCompletor::PerfectMatchedProc.(":aiueo", bind: binding))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue