summaryrefslogtreecommitdiff
path: root/test/irb/test_completion.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/irb/test_completion.rb')
-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