diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-17 16:56:53 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-17 16:56:53 +0900 |
commit | c98c492578d898dc07a04b8240d8d5b1508ffafa (patch) | |
tree | 13cc2f9663bfdb36f4803b054da40784111b6e67 /test | |
parent | f9788ca7fe645be50f9248264253b453820d1d35 (diff) |
Added test for f38b3e8c707ebdcad05aa9485cf1760640b74fbb
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_ast.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 4c156650b8..147d05eadf 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -42,10 +42,11 @@ class TestAst < Test::Unit::TestCase 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 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 |