mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
3abb4948b2
commit
1997f7807b
1 changed files with 15 additions and 0 deletions
|
@ -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 = []
|
||||
|
|
Loading…
Add table
Reference in a new issue