diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/rdoc/test_rdoc_markup_attribute_manager.rb | 24 | ||||
-rw-r--r-- | test/rdoc/test_rdoc_markup_to_html.rb | 6 |
2 files changed, 27 insertions, 3 deletions
diff --git a/test/rdoc/test_rdoc_markup_attribute_manager.rb b/test/rdoc/test_rdoc_markup_attribute_manager.rb index a180666867..2ec135dca7 100644 --- a/test/rdoc/test_rdoc_markup_attribute_manager.rb +++ b/test/rdoc/test_rdoc_markup_attribute_manager.rb @@ -172,22 +172,25 @@ class TestRDocMarkupAttributeManager < RDoc::TestCase def test_convert_attrs str = '+foo+'.dup - attrs = RDoc::Markup::AttrSpan.new str.length + attrs = RDoc::Markup::AttrSpan.new str.length, @am.exclusive_bitmap + @am.convert_attrs str, attrs, true @am.convert_attrs str, attrs assert_equal "\000foo\000", str str = '+:foo:+'.dup - attrs = RDoc::Markup::AttrSpan.new str.length + attrs = RDoc::Markup::AttrSpan.new str.length, @am.exclusive_bitmap + @am.convert_attrs str, attrs, true @am.convert_attrs str, attrs assert_equal "\000:foo:\000", str str = '+x-y+'.dup - attrs = RDoc::Markup::AttrSpan.new str.length + attrs = RDoc::Markup::AttrSpan.new str.length, @am.exclusive_bitmap + @am.convert_attrs str, attrs, true @am.convert_attrs str, attrs assert_equal "\000x-y\000", str @@ -243,6 +246,21 @@ class TestRDocMarkupAttributeManager < RDoc::TestCase output('unhandled <p>tag</p> unchanged') end + def test_exclude_tag + assert_equal '<CODE>aaa</CODE>[:symbol]', output('+aaa+[:symbol]') + assert_equal '<CODE>aaa[:symbol]</CODE>', output('+aaa[:symbol]+') + assert_equal 'aaa[:symbol]', output('aaa[:symbol]') + end + + def test_exclude_tag_flow + assert_equal [@tt_on, "aaa", @tt_off, "[:symbol]"], + @am.flow("+aaa+[:symbol]") + assert_equal [@tt_on, "aaa[:symbol]", @tt_off], + @am.flow("+aaa[:symbol]+") + assert_equal ["aaa[:symbol]"], + @am.flow("aaa[:symbol]") + end + def test_html_like_em_bold assert_equal ["cat ", @em_on, "and ", @em_to_bold, "dog", @bold_off], @am.flow("cat <i>and </i><b>dog</b>") diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb index fb94269064..6ec52989c7 100644 --- a/test/rdoc/test_rdoc_markup_to_html.rb +++ b/test/rdoc/test_rdoc_markup_to_html.rb @@ -704,6 +704,12 @@ EXPECTED assert_equal "\n<p><a href=\"irc://irc.freenode.net/#ruby-lang\">ruby-lang</a></p>\n", result end + def test_convert_with_exclude_tag + assert_equal "\n<p><code>aaa</code>[:symbol]</p>\n", @to.convert('+aaa+[:symbol]') + assert_equal "\n<p><code>aaa[:symbol]</code></p>\n", @to.convert('+aaa[:symbol]+') + assert_equal "\n<p><a href=\":symbol\">aaa</a></p>\n", @to.convert('aaa[:symbol]') + end + def test_gen_url assert_equal '<a href="example">example</a>', @to.gen_url('link:example', 'example') |