File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1650,6 +1650,28 @@ def test_parse_method
1650
1650
assert_equal stream , foo . token_stream
1651
1651
end
1652
1652
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
+
1653
1675
def test_parse_method_alias
1654
1676
klass = RDoc ::NormalClass . new 'Foo'
1655
1677
klass . parent = @top_level
You can’t perform that action at this time.
0 commit comments