diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-07 18:45:49 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-07 18:57:58 +0900 |
commit | 6566919176834efb47ea717967669ca83eb78347 (patch) | |
tree | 6366383ce93112cc60013ce3dc39533f02ec8144 /test/rdoc | |
parent | a6a26e42b15c46f117f4fce07a2050e9d727355d (diff) | |
download | ruby-6566919176834efb47ea717967669ca83eb78347.tar.gz |
ripper_state_lex.rb: chomp CR
* lib/rdoc/parser/ripper_state_lex.rb (RDoc::Parser::RipperStateLex):
chomp newline, including CR, from here document terminator.
Closes: ruby/rdoc#694
Closes: ruby/rdoc#697
Closes: ruby/rdoc#705
Diffstat (limited to 'test/rdoc')
-rw-r--r-- | test/rdoc/test_rdoc_parser_ruby.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_parser_ruby.rb b/test/rdoc/test_rdoc_parser_ruby.rb index 8188318769..97abafca58 100644 --- a/test/rdoc/test_rdoc_parser_ruby.rb +++ b/test/rdoc/test_rdoc_parser_ruby.rb @@ -2914,6 +2914,21 @@ EXPECTED assert_equal expected, markup_code end + def test_parse_heredoc_end + code = "A = <<eos\n""OK\n""eos\n" + util_parser code + @parser.parse_statements @top_level + @parser.scan + c = @top_level.classes.first.constants.first + assert_equal("A", c.name) + + util_parser code.gsub(/$/, "\r") + @parser.parse_statements @top_level + @parser.scan + c = @top_level.classes.first.constants.first + assert_equal("A", c.name) + end + def test_parse_statements_method_oneliner_with_regexp util_parser <<RUBY class Foo |