summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorst0012 <[email protected]>2022-10-27 11:55:40 +0100
committergit <[email protected]>2022-10-27 15:25:39 +0000
commit26b913c88b087a93f5a7a5f8282d1934b6c5073e ()
tree5c6a1281df9fba0c6421880bf5db0e54f830626e
parent5129ca3e056e1ce3189ba39fa311d4d687b97b45 (diff)
[ruby/irb] Add test for IRB::InputCompletor::PerfectMatchedProc
This proc displays rdoc document when the input matches certain symbols perfectly, like "String". It's commonly triggered with autocompletion but only has 1 test case. So this commit increases its test coverage. https://.com/ruby/irb/commit/d85d719313
-rw-r--r--test/irb/test_completion.rb94
1 files changed, 90 insertions, 4 deletions
@@ -211,6 +211,96 @@ module TestIRB
end
end
def test_complete_symbol
%w"UTF-16LE UTF-7".each do |enc|
"K".force_encoding(enc).to_sym
@@ -233,10 +323,6 @@ module TestIRB
assert_empty(IRB::InputCompletor.retrieve_completion_data("::A)", bind: binding))
end
- def test_complete_symbol_failure
- assert_nil(IRB::InputCompletor::PerfectMatchedProc.(":aiueo", bind: binding))
- end
-
def test_complete_reserved_words
candidates = IRB::InputCompletor.retrieve_completion_data("de", bind: binding)
%w[def defined?].each do |word|