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
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
You can’t perform that action at this time.
0 commit comments