diff options
-rw-r--r-- | lib/irb/completion.rb | 2 | ||||
-rw-r--r-- | test/irb/test_completion.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 812ebb09e7..fe2962e780 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -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 diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb index 1ae1b7a0b9..f00eda0058 100644 --- a/test/irb/test_completion.rb +++ b/test/irb/test_completion.rb @@ -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 |