summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/irb/test_ruby-lex.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/irb/test_ruby-lex.rb b/test/irb/test_ruby-lex.rb
new file mode 100644
index 00000000000..f7d331bc248
--- /dev/null
+++ b/test/irb/test_ruby-lex.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: false
+require 'test/unit'
+require 'irb/ruby-lex'
+
+module TestIRB
+ class TestRubyLex < Test::Unit::TestCase
+ def setup
+ @scanner = RubyLex.new
+ end
+
+ def test_set_input_proc
+ called = false
+ @scanner.set_input(self) {|x| called = true; nil}
+ assert_nil(@scanner.lex)
+ assert(called)
+ end
+ end
+end