[前][次][番号順一覧][スレッド一覧]

ruby-changes:65396

From: aycabta <ko1@a...>
Date: Fri, 5 Mar 2021 22:03:24 +0900 (JST)
Subject: [ruby-changes:65396] 182cde8dfb (master): [ruby/irb] Add a test for not continuing when endless range at eol

https://git.ruby-lang.org/ruby.git/commit/?id=182cde8dfb

From 182cde8dfbbc6b9044d9b76c0bfdcf031bcda778 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Thu, 4 Mar 2021 22:44:53 +0900
Subject: [ruby/irb] Add a test for not continuing when endless range at eol

https://github.com/ruby/irb/commit/1020ac9c65
---
 test/irb/test_ruby_lex.rb | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb
index a45ca66..1981939 100644
--- a/test/irb/test_ruby_lex.rb
+++ b/test/irb/test_ruby_lex.rb
@@ -136,6 +136,20 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_ruby_lex.rb#L136
       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),
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]