Skip to content

Commit a2c9282

Browse files
committed
Add test_class_tokenize_symbol_for_method
1 parent 4fcbe6b commit a2c9282

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/test_rdoc_ruby_lex.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,22 @@ def test_class_tokenize_symbol
927927
assert_equal expected, tokens
928928
end
929929

930+
def test_class_tokenize_symbol_for_method
931+
tokens = RDoc::RubyLex.tokenize 'meth("key": :val)', nil
932+
933+
expected = [
934+
@TK::TkIDENTIFIER.new( 0, 1, 0, 'meth'),
935+
@TK::TkLPAREN .new( 4, 1, 4, '('),
936+
@TK::TkSYMBOL .new( 5, 1, 5, '"key":'),
937+
@TK::TkSPACE .new(11, 1, 11, ' '),
938+
@TK::TkSYMBOL .new(12, 1, 12, ':val'),
939+
@TK::TkRPAREN .new(16, 1, 16, ')'),
940+
@TK::TkNL .new(17, 1, 17, "\n"),
941+
]
942+
943+
assert_equal expected, tokens
944+
end
945+
930946
def test_class_tokenize_particular_kind_of_symbols
931947
tokens = RDoc::RubyLex.tokenize '{ Thomas: :Thomas, Dave!: :Dave!, undef: :undef }', nil
932948

0 commit comments

Comments
 (0)