Skip to content

Commit 98c7020

Browse files
committed
Add test_class_tokenize_hash_rocket
1 parent 6c37045 commit 98c7020

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test_rdoc_ruby_lex.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,24 @@ def test_class_tokenize_percent_w_quote
286286
assert_equal expected, tokens
287287
end
288288

289+
def test_class_tokenize_hash_rocket
290+
tokens = RDoc::RubyLex.tokenize "{ :foo=> 1 }", nil
291+
292+
expected = [
293+
@TK::TkLBRACE .new( 0, 1, 0, '{'),
294+
@TK::TkSPACE .new( 1, 1, 1, ' '),
295+
@TK::TkSYMBOL .new( 2, 1, 2, ':foo'),
296+
@TK::TkHASHROCKET.new( 6, 1, 6, '=>'),
297+
@TK::TkSPACE .new( 8, 1, 8, ' '),
298+
@TK::TkINTEGER .new( 9, 1, 9, '1'),
299+
@TK::TkSPACE .new(10, 1, 10, ' '),
300+
@TK::TkRBRACE .new(11, 1, 11, '}'),
301+
@TK::TkNL .new(12, 1, 12, "\n")
302+
]
303+
304+
assert_equal expected, tokens
305+
end
306+
289307
def test_class_tokenize_regexp
290308
tokens = RDoc::RubyLex.tokenize "/hay/", nil
291309

0 commit comments

Comments
 (0)