зеркало из https://github.com/github/ruby.git
test for top level statement
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3abb4948b2
Коммит
1997f7807b
|
@ -20,6 +20,21 @@ module TestIRB
|
|||
assert_equal([["#\n", 1]], top_level_statement("#\n"))
|
||||
end
|
||||
|
||||
def test_top_level_statement
|
||||
result = top_level_statement("#{<<-"begin;"}#{<<~"end;"}")
|
||||
begin;
|
||||
begin
|
||||
end
|
||||
begin
|
||||
end
|
||||
end;
|
||||
assert_equal([
|
||||
["begin\n""end\n", 1],
|
||||
["begin\n""end\n", 3],
|
||||
],
|
||||
result)
|
||||
end
|
||||
|
||||
def top_level_statement(lines)
|
||||
input = InputLines.new(lines, "r")
|
||||
scanned = []
|
||||
|
|
Загрузка…
Ссылка в новой задаче