diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-05 02:22:37 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-05 02:22:37 +0000 |
commit | f177c73edb16a62a3e1a06368ede687c5a5c53ff (patch) | |
tree | 7a1ceecb949b07f735b376c9b6fee4d3a688ff33 /test/ruby | |
parent | 11d5ad0b842283403377b98d3f494d00241398da (diff) |
merge revision(s) 58561: [Backport #13540]
parse.y: make shared string modifiable
* parse.y (dedent_string): ensure that the string is modifiable,
not to set the length of shared string.
[ruby-core:80987] [Bug #13540]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_parse.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index ebdb2451a7..18e7d8f87c 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -970,6 +970,16 @@ x = __ENCODING__ assert_equal(-100, e.backtrace_locations.first.lineno, bug) end + def test_file_in_indented_heredoc + name = '[ruby-core:80987] [Bug #13540]' # long enough to be shared + assert_equal(name+"\n", eval("#{<<-"begin;"}\n#{<<-'end;'}", nil, name)) + begin; + <<~HEREDOC + #{__FILE__} + HEREDOC + end; + end + =begin def test_past_scope_variable assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}} |