diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-02-02 10:52:38 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-02-02 12:20:10 +0900 |
commit | fad48fefe19cc282a5b209944244a3713359b47f (patch) | |
tree | bf63879d90d418049f61245f9e807bdcb09d783c /test/ripper | |
parent | f499c81b01b5c4b7a2ce11d6467d793669d67695 (diff) | |
download | ruby-fad48fefe19cc282a5b209944244a3713359b47f.tar.gz |
[Bug #19399] Parsing invalid heredoc inside block parameter
Although this is of course invalid as Ruby code, allow to just parse
and tokenize.
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_lexer.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ripper/test_lexer.rb b/test/ripper/test_lexer.rb index 27e0007023..8e8a616627 100644 --- a/test/ripper/test_lexer.rb +++ b/test/ripper/test_lexer.rb @@ -252,4 +252,16 @@ world" ] assert_equal(code, Ripper.tokenize(code).join(""), bug) end + + def test_heredoc_inside_block_param + bug = '[Bug #19399]' + code = <<~CODE + a do |b + <<-C + C + | + end + CODE + assert_equal(code, Ripper.tokenize(code).join(""), bug) + end end |