summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuhiro IMAI <nov@yo.rim.or.jp>2020-02-12 19:16:12 +0900
committeraycabta <aycabta@gmail.com>2020-02-15 21:52:03 +0900
commit961630126b8081ea57b57cde3184e9ecfd86ff96 (patch)
tree2cb6acff5aa1f03efc3fee6ae523e303dbb6e6fc /test
parent38f1e84c37b91ddf9e61428d298eb27bee3bd2bc (diff)
[ruby/irb] fix reserved words and completion for them
https://github.com/ruby/irb/commit/6184b227ad
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_completion.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb
index d4072fe892..a765bbf3a5 100644
--- a/test/irb/test_completion.rb
+++ b/test/irb/test_completion.rb
@@ -35,5 +35,17 @@ module TestIRB
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|
+ assert_include candidates, word
+ end
+
+ candidates = IRB::InputCompletor.retrieve_completion_data("__", bind: binding)
+ %w[__ENCODING__ __LINE__ __FILE__].each do |word|
+ assert_include candidates, word
+ end
+ end
end
end