Skip to content

Commit 4d29fbf

Browse files
committed
Add test_class_tokenize_constant_with_exclamation
1 parent 97c6c6b commit 4d29fbf

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
@@ -523,5 +523,21 @@ def test_class_tokenize_square_bracket_as_method
523523
assert_equal expected, tokens
524524
end
525525

526+
def test_class_tokenize_constant_with_exclamation
527+
tokens = RDoc::RubyLex.tokenize "Hello there, Dave!", nil
528+
529+
expected = [
530+
@TK::TkCONSTANT .new( 0, 1, 0, "Hello"),
531+
@TK::TkSPACE .new( 5, 1, 5, " "),
532+
@TK::TkIDENTIFIER.new( 6, 1, 6, "there"),
533+
@TK::TkCOMMA .new(11, 1, 11, ","),
534+
@TK::TkSPACE .new(12, 1, 12, " "),
535+
@TK::TkIDENTIFIER.new(13, 1, 13, "Dave!"),
536+
@TK::TkNL .new(18, 1, 18, "\n")
537+
]
538+
539+
assert_equal expected, tokens
540+
end
541+
526542
end
527543

0 commit comments

Comments
 (0)