summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-29 12:53:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-29 12:53:23 +0000
commit1997f7807bfea7710bc6d5bcabb39ad9ba59769c (patch)
tree8ec8c3e0b46fdcf1e9cc7664981b446dbf2647b5
parent3abb4948b248da896e0bf03de6caf147543a5432 (diff)
test for top level statement
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/irb/test_ruby-lex.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/irb/test_ruby-lex.rb b/test/irb/test_ruby-lex.rb
index b5255e9b536..ba6774544ed 100644
--- a/test/irb/test_ruby-lex.rb
+++ b/test/irb/test_ruby-lex.rb
@@ -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 = []