aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-20 02:43:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-20 02:43:34 +0000
commit9d5abbff9754589483938dc539226c2ad4895140 (patch)
tree4069ea0426a16c1c1f05e2d619d532167d8ab77d /test/ruby/test_syntax.rb
parenta8b0c2529301df76a1ea8c03ead3d0d163ab56bc (diff)
downloadruby-9d5abbff9754589483938dc539226c2ad4895140.tar.gz
parse.y: labeled heredoc
* parse.y (parser_yylex): allow here documents in labeled argument. [ruby-core:72396] [Bug #11849] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 77cb3ea54e..b8f1619ae2 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -342,6 +342,12 @@ WARN
assert_valid_syntax('{label: %w(*)}', bug11812)
end
+ def test_heredoc_after_label
+ bug11849 = '[ruby-core:72396] [Bug #11849]'
+ assert_valid_syntax("{label:<<DOC\n""DOC\n""}", bug11849)
+ assert_valid_syntax("{label: <<DOC\n""DOC\n""}", bug11849)
+ end
+
def test_duplicated_arg
assert_syntax_error("def foo(a, a) end", /duplicated argument name/)
assert_nothing_raised { def foo(_, _) end }