summaryrefslogtreecommitdiff
path: root/test/irb
diff options
context:
space:
mode:
Diffstat (limited to 'test/irb')
-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 b5255e9b53..ba6774544e 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 = []