зеркало из https://github.com/github/ruby.git
Added test for f38b3e8c70
This commit is contained in:
Родитель
f9788ca7fe
Коммит
c98c492578
|
@ -42,10 +42,11 @@ class TestAst < Test::Unit::TestCase
|
||||||
class Helper
|
class Helper
|
||||||
attr_reader :errors
|
attr_reader :errors
|
||||||
|
|
||||||
def initialize(path)
|
def initialize(path, src: nil)
|
||||||
@path = path
|
@path = path
|
||||||
@errors = []
|
@errors = []
|
||||||
@debug = false
|
@debug = false
|
||||||
|
@ast = RubyVM::AbstractSyntaxTree.parse(src) if src
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_range
|
def validate_range
|
||||||
|
@ -312,4 +313,10 @@ class TestAst < Test::Unit::TestCase
|
||||||
assert_equal(false, kwrest.call('**nil'))
|
assert_equal(false, kwrest.call('**nil'))
|
||||||
assert_equal([:a], kwrest.call('**a'))
|
assert_equal([:a], kwrest.call('**a'))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_ranges_numbered_parameter
|
||||||
|
helper = Helper.new(__FILE__, src: "1.times {_1}")
|
||||||
|
helper.validate_range
|
||||||
|
assert_equal([], helper.errors)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Загрузка…
Ссылка в новой задаче