1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Nobuyoshi Nakada 2020-01-17 16:56:53 +09:00
parent f9788ca7fe
commit c98c492578
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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