summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_markup_to_html.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-10 01:58:09 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-05 11:34:33 +0900
commit7c8aa0a5d2bc3f079077d113b350a58d7b7c2b0d (patch)
tree0bed6d29e4bcfde19dad6dc9833f2ec6938f648f /test/rdoc/test_rdoc_markup_to_html.rb
parent46ab28d6c9a80e91f6f56e9f902e0eff8eb1207e (diff)
[ruby/rdoc] Allow a label in a link to another document text
https://github.com/ruby/rdoc/commit/85bb2d33bb
Diffstat (limited to 'test/rdoc/test_rdoc_markup_to_html.rb')
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb
index 29da968abc..f7887f081b 100644
--- a/test/rdoc/test_rdoc_markup_to_html.rb
+++ b/test/rdoc/test_rdoc_markup_to_html.rb
@@ -743,6 +743,10 @@ EXPECTED
@to.gen_url('doc/example.rdoc', 'example')
assert_equal '<a href="../ex_doc/example_rdoc.html">example</a>',
@to.gen_url('../ex.doc/example.rdoc', 'example')
+ assert_equal '<a href="doc/example_rdoc.html#label-one">example</a>',
+ @to.gen_url('doc/example.rdoc#label-one', 'example')
+ assert_equal '<a href="../ex_doc/example_rdoc.html#label-two">example</a>',
+ @to.gen_url('../ex.doc/example.rdoc#label-two', 'example')
end
def test_gen_url_md_file
@@ -750,6 +754,10 @@ EXPECTED
@to.gen_url('doc/example.md', 'example')
assert_equal '<a href="../ex_doc/example_md.html">example</a>',
@to.gen_url('../ex.doc/example.md', 'example')
+ assert_equal '<a href="doc/example_md.html#label-one">example</a>',
+ @to.gen_url('doc/example.md#label-one', 'example')
+ assert_equal '<a href="../ex_doc/example_md.html#label-two">example</a>',
+ @to.gen_url('../ex.doc/example.md#label-two', 'example')
end
def test_gen_url_rb_file
@@ -757,6 +765,10 @@ EXPECTED
@to.gen_url('doc/example.rb', 'example')
assert_equal '<a href="../ex_doc/example_rb.html">example</a>',
@to.gen_url('../ex.doc/example.rb', 'example')
+ assert_equal '<a href="doc/example_rb.html#label-one">example</a>',
+ @to.gen_url('doc/example.rb#label-one', 'example')
+ assert_equal '<a href="../ex_doc/example_rb.html#label-two">example</a>',
+ @to.gen_url('../ex.doc/example.rb#label-two', 'example')
end
def test_handle_regexp_HYPERLINK_link