summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-01 05:25:13 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-01 05:25:13 +0000
commita429cafc4d95c0543e3fb234f1762067ee0b5304 (patch)
treead85881029b8ca877890dd66f23bccd46af04181 /test
parent7d2efc1fdaa0251ae8ceb8e437ade37e8b2a28fa (diff)
* 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
Diffstat (limited to 'test')
-rw-r--r--test/rdoc/test_rdoc_markup_parser.rb34
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb8
2 files changed, 42 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_markup_parser.rb b/test/rdoc/test_rdoc_markup_parser.rb
index a9d2a1b4fb..e214c4defc 100644
--- a/test/rdoc/test_rdoc_markup_parser.rb
+++ b/test/rdoc/test_rdoc_markup_parser.rb
@@ -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
= =
diff --git a/test/rdoc/test_rdoc_markup_to_html_crossref.rb b/test/rdoc/test_rdoc_markup_to_html_crossref.rb
index 4611e45309..2c566f0140 100644
--- a/test/rdoc/test_rdoc_markup_to_html_crossref.rb
+++ b/test/rdoc/test_rdoc_markup_to_html_crossref.rb
@@ -25,6 +25,14 @@ class TestRDocMarkupToHtmlCrossref < XrefTestCase
assert_equal "\n<p><a href=\"C1.html\">C1</a></p>\n", result
end
+ def test_gen_url
+ assert_equal '<a href="C1.html">Some class</a>',
+ @to.gen_url('rdoc-ref:C1', 'Some class')
+
+ assert_equal '<a href="http://example">HTTP example</a>',
+ @to.gen_url('http://example', 'HTTP example')
+ end
+
def test_handle_special_CROSSREF
assert_equal "<a href=\"C2/C3.html\">C2::C3</a>", SPECIAL('C2::C3')
end