mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc.rb: Import RDoc 3.9.1. Fixes bugs in the RDoc::Markup
parser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7d2efc1fda
commit
a429cafc4d
7 changed files with 61 additions and 7 deletions
|
|
@ -248,6 +248,23 @@ the time
|
|||
assert_equal expected, @RMP.parse(str).parts
|
||||
end
|
||||
|
||||
def test_parse_heading_empty
|
||||
str = <<-STR
|
||||
===
|
||||
* bullet
|
||||
STR
|
||||
|
||||
expected = [
|
||||
@RM::Heading.new(3, ''),
|
||||
@RM::BlankLine.new,
|
||||
@RM::List.new(:BULLET, *[
|
||||
@RM::ListItem.new(nil,
|
||||
@RM::Paragraph.new('bullet'))]),
|
||||
]
|
||||
|
||||
assert_equal expected, @RMP.parse(str).parts
|
||||
end
|
||||
|
||||
def test_parse_heading_heading
|
||||
str = '= ='
|
||||
|
||||
|
|
@ -1085,6 +1102,23 @@ the time
|
|||
assert_equal expected, @RMP.tokenize(str)
|
||||
end
|
||||
|
||||
def test_tokenize_heading_empty
|
||||
str = <<-STR
|
||||
===
|
||||
* bullet
|
||||
STR
|
||||
|
||||
expected = [
|
||||
[:HEADER, 3, 0, 0],
|
||||
[:NEWLINE, "\n", 3, 0],
|
||||
[:BULLET, "*", 0, 1],
|
||||
[:TEXT, "bullet", 2, 1],
|
||||
[:NEWLINE, "\n", 8, 1],
|
||||
]
|
||||
|
||||
assert_equal expected, @RMP.tokenize(str)
|
||||
end
|
||||
|
||||
def test_tokenize_heading_heading
|
||||
str = <<-STR
|
||||
= =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue