diff options
author | aycabta <aycabta@gmail.com> | 2021-03-24 15:33:07 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-03-25 18:54:02 +0900 |
commit | ad8842c06d26ee634f90008efecf1cd4d76342df (patch) | |
tree | 06a162d412417ec31ced7eaf4d8f87951201ebda /test | |
parent | f45bed0a6e983abfe616455ced2e50db381ba2dd (diff) |
[ruby/irb] Cache completion files to require
https://github.com/ruby/irb/commit/612ebcb311
Diffstat (limited to 'test')
-rw-r--r-- | test/irb/test_completion.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb index 04ac6dba5b..535690ae22 100644 --- a/test/irb/test_completion.rb +++ b/test/irb/test_completion.rb @@ -61,6 +61,11 @@ module TestIRB %w['irb/init 'irb/ruby-lex].each do |word| assert_include candidates, word end + # Test cache + candidates = IRB::InputCompletor::CompletionProc.("'irb", "require ", "") + %w['irb/init 'irb/ruby-lex].each do |word| + assert_include candidates, word + end end def test_complete_require_relative @@ -70,6 +75,13 @@ module TestIRB %w['lib/irb/init 'lib/irb/ruby-lex].each do |word| assert_include candidates, word end + # Test cache + candidates = Dir.chdir(__dir__ + "/../..") do + IRB::InputCompletor::CompletionProc.("'lib/irb", "require_relative ", "") + end + %w['lib/irb/init 'lib/irb/ruby-lex].each do |word| + assert_include candidates, word + end end end end |