summaryrefslogtreecommitdiff
path: root/test/irb/test_completion.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-04-26 18:28:54 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-04-26 18:28:57 +0900
commit52cfb17086998b9434c9c786bfcf827197216c9a (patch)
treea94e98569e51a9b4cccc8b6ba481b3f7080061ab /test/irb/test_completion.rb
parenta6805771ec202a8b8586d6624b05342029cace0d (diff)
downloadruby-52cfb17086998b9434c9c786bfcf827197216c9a.tar.gz
make sync-default-gems GEM=irb
from https://github.com/ruby/irb/commit/e6739d8c66dc78562930adb0b96935c9b38acf74
Diffstat (limited to 'test/irb/test_completion.rb')
-rw-r--r--test/irb/test_completion.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb
new file mode 100644
index 0000000000..608c41bad9
--- /dev/null
+++ b/test/irb/test_completion.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: false
+require 'test/unit'
+
+module TestIRB
+ class TestCompletion < Test::Unit::TestCase
+ def test_nonstring_module_name
+ begin
+ require "irb/completion"
+ bug5938 = '[ruby-core:42244]'
+ cmds = %W[-rirb -rirb/completion -e IRB.setup(__FILE__)
+ -e IRB.conf[:MAIN_CONTEXT]=IRB::Irb.new.context
+ -e module\sFoo;def\sself.name;//;end;end
+ -e IRB::InputCompletor::CompletionProc.call("[1].first.")
+ -- -f --]
+ status = assert_in_out_err(cmds, "", //, [], bug5938)
+ assert(status.success?, bug5938)
+ rescue LoadError
+ skip "cannot load irb/completion"
+ end
+ end
+ end
+end