summaryrefslogtreecommitdiff
path: root/test/irb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-03-04 22:44:53 +0900
committergit <svn-admin@ruby-lang.org>2021-03-05 22:03:11 +0900
commit182cde8dfbbc6b9044d9b76c0bfdcf031bcda778 (patch)
tree3c09e716f1f26f5365b8806e33a74d8976d25983 /test/irb
parent2cc5827fdca97dbd1225a49a3114d28aa1cb2ef4 (diff)
[ruby/irb] Add a test for not continuing when endless range at eol
https://github.com/ruby/irb/commit/1020ac9c65
Diffstat (limited to 'test/irb')
-rw-r--r--test/irb/test_ruby_lex.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb
index a45ca668b9..1981939848 100644
--- a/test/irb/test_ruby_lex.rb
+++ b/test/irb/test_ruby_lex.rb
@@ -136,6 +136,20 @@ module TestIRB
end
end
+ def test_endless_range_at_end_of_line
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.6.0')
+ skip 'Endless range is available in 2.6.0 or later'
+ end
+ input_with_prompt = [
+ PromptRow.new('001:0: :> ', %q(a = 3..)),
+ PromptRow.new('002:0: :* ', %q()),
+ ]
+
+ lines = input_with_prompt.map(&:content)
+ expected_prompt_list = input_with_prompt.map(&:prompt)
+ assert_dynamic_prompt(lines, expected_prompt_list)
+ end
+
def test_incomplete_coding_magic_comment
input_with_correct_indents = [
Row.new(%q(#coding:u), nil, 0),