Skip to content

Commit faaa724

Browse files
committed
Add test_class_tokenize_symbol_for_nested_method
1 parent 8ac1956 commit faaa724

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/test_rdoc_ruby_lex.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,21 @@ def test_class_tokenize_symbol
520520
assert_equal expected, tokens
521521
end
522522

523+
def test_class_tokenize_symbol_for_nested_method
524+
tokens = RDoc::RubyLex.tokenize 'return untrace_var :name', nil
525+
526+
expected = [
527+
@TK::TkRETURN .new( 0, 1, 0, "return"),
528+
@TK::TkSPACE .new( 6, 1, 6, " "),
529+
@TK::TkIDENTIFIER.new( 7, 1, 7, "untrace_var"),
530+
@TK::TkSPACE .new(18, 1, 18, " "),
531+
@TK::TkSYMBOL .new(19, 1, 19, ":name"),
532+
@TK::TkNL .new(24, 1, 24, "\n"),
533+
]
534+
535+
assert_equal expected, tokens
536+
end
537+
523538
def test_unary_minus
524539
ruby_lex = RDoc::RubyLex.new("-1", nil)
525540
assert_equal("-1", ruby_lex.token.value)

0 commit comments

Comments
 (0)