Skip to content

Commit 35141c8

Browse files
author
Zachary Scott
authored
Merge pull request #463 from aycabta/add-test-parse-method-bracket
Add test_parse_method_bracket
2 parents ec49db2 + 013515f commit 35141c8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/test_rdoc_parser_ruby.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,28 @@ def test_parse_method
16501650
assert_equal stream, foo.token_stream
16511651
end
16521652

1653+
def test_parse_method_bracket
1654+
util_parser <<-RUBY
1655+
class C
1656+
def [] end
1657+
def self.[] end
1658+
def []= end
1659+
def self.[]= end
1660+
end
1661+
RUBY
1662+
1663+
@parser.scan
1664+
1665+
c = @store.find_class_named 'C'
1666+
1667+
assert_equal 4, c.method_list.size
1668+
assert_equal 'C#[]', c.method_list[0].full_name
1669+
assert_equal 'C::[]', c.method_list[1].full_name
1670+
assert_equal 'C#[]=', c.method_list[2].full_name
1671+
assert_equal 'C::[]=', c.method_list[3].full_name
1672+
assert c.aliases.empty?
1673+
end
1674+
16531675
def test_parse_method_alias
16541676
klass = RDoc::NormalClass.new 'Foo'
16551677
klass.parent = @top_level

0 commit comments

Comments
 (0)