From ad8842c06d26ee634f90008efecf1cd4d76342df Mon Sep 17 00:00:00 2001 From: aycabta Date: Wed, 24 Mar 2021 15:33:07 +0900 Subject: [ruby/irb] Cache completion files to require https://github.com/ruby/irb/commit/612ebcb311 --- test/irb/test_completion.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') 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 -- cgit v1.2.3