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

ruby-changes:59726

From: Nobuyoshi <ko1@a...>
Date: Fri, 17 Jan 2020 16:57:35 +0900 (JST)
Subject: [ruby-changes:59726] c98c492578 (master): Added test for f38b3e8c707ebdcad05aa9485cf1760640b74fbb

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

From c98c492578d898dc07a04b8240d8d5b1508ffafa Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 17 Jan 2020 16:56:53 +0900
Subject: Added test for f38b3e8c707ebdcad05aa9485cf1760640b74fbb


diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 4c15665..147d05e 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -42,10 +42,11 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L42
   class Helper
     attr_reader :errors
 
-    def initialize(path)
+    def initialize(path, src: nil)
       @path = path
       @errors = []
       @debug = false
+      @ast = RubyVM::AbstractSyntaxTree.parse(src) if src
     end
 
     def validate_range
@@ -312,4 +313,10 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L313
     assert_equal(false, kwrest.call('**nil'))
     assert_equal([:a], kwrest.call('**a'))
   end
+
+  def test_ranges_numbered_parameter
+    helper = Helper.new(__FILE__, src: "1.times {_1}")
+    helper.validate_range
+    assert_equal([], helper.errors)
+  end
 end
-- 
cgit v0.10.2


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

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