File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -996,9 +996,9 @@ def name_regexp name
996996
997997 case type
998998 when '#' , '::' then
999- /^#{ klass } #{ type } #{ name } $/
999+ /^#{ klass } #{ type } #{ Regexp . escape name } $/
10001000 else
1001- /^#{ klass } (#|::)#{ name } $/
1001+ /^#{ klass } (#|::)#{ Regexp . escape name } $/
10021002 end
10031003 end
10041004
Original file line number Diff line number Diff line change @@ -572,11 +572,18 @@ def test_method_type
572572 def test_name_regexp
573573 assert_equal %r%^RDoc::AnyMethod#new$% ,
574574 @driver . name_regexp ( 'RDoc::AnyMethod#new' )
575+
575576 assert_equal %r%^RDoc::AnyMethod::new$% ,
576577 @driver . name_regexp ( 'RDoc::AnyMethod::new' )
577578
578579 assert_equal %r%^RDoc::AnyMethod(#|::)new$% ,
579580 @driver . name_regexp ( 'RDoc::AnyMethod.new' )
581+
582+ assert_equal %r%^Hash(#|::)\[ \] $% ,
583+ @driver . name_regexp ( 'Hash.[]' )
584+
585+ assert_equal %r%^Hash::\[ \] $% ,
586+ @driver . name_regexp ( 'Hash::[]' )
580587 end
581588
582589 def test_list_known_classes
You can’t perform that action at this time.
0 commit comments