summaryrefslogtreecommitdiff
path: root/test/rdoc
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-07-15 17:39:21 -0400
committergit <svn-admin@ruby-lang.org>2022-07-18 22:36:57 +0900
commitdd362a786af7f5131844652fa85a07539b4da9b8 (patch)
tree4308d2b66136c45bf6d98346f6cd10972d6bb858 /test/rdoc
parenta74634de106df63fb39a7077561657bb61a0bc97 (diff)
[ruby/rdoc] Fix call-seq for aliased method with similar names
deduplicate_call_seq has a bug that skips call-seq for methods where the alias is a prefix of the method name. For example, if the alias name is "each" and the current method name is "each_line", then deduplicate_call_seq will skip all call-seq for "each_line" since it will believe that it is for the alias. https://github.com/ruby/rdoc/commit/1148988ccc
Diffstat (limited to 'test/rdoc')
-rw-r--r--test/rdoc/test_rdoc_any_method.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_any_method.rb b/test/rdoc/test_rdoc_any_method.rb
index 826ef1c8d8..6915b466f0 100644
--- a/test/rdoc/test_rdoc_any_method.rb
+++ b/test/rdoc/test_rdoc_any_method.rb
@@ -51,6 +51,20 @@ method(a, b) { |c, d| ... }
assert_equal 'foo', m.call_seq
end
+ def test_call_seq_alias_for
+ a = RDoc::AnyMethod.new nil, "each"
+ m = RDoc::AnyMethod.new nil, "each_line"
+
+ a.call_seq = <<-CALLSEQ
+each(foo)
+each_line(foo)
+ CALLSEQ
+
+ m.is_alias_for = a
+
+ assert_equal "each_line(foo)", m.call_seq
+ end
+
def test_full_name
assert_equal 'C1::m', @c1.method_list.first.full_name
end