Skip to content

Commit f291a7d

Browse files
committed
Add test_class_tokenize_double_colon_is_not_hash_symbol
1 parent f6af91b commit f291a7d

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
@@ -90,6 +90,21 @@ def test_class_tokenize_hash_symbol
9090
assert_equal expected, tokens
9191
end
9292

93+
def test_class_tokenize_double_colon_is_not_hash_symbol
94+
tokens = RDoc::RubyLex.tokenize 'self.class::Row', nil
95+
96+
expected = [
97+
@TK::TkSELF .new( 0, 1, 0, "self"),
98+
@TK::TkDOT .new( 4, 1, 4, "."),
99+
@TK::TkIDENTIFIER.new( 5, 1, 5, "class"),
100+
@TK::TkCOLON2 .new(10, 1, 10, "::"),
101+
@TK::TkCONSTANT .new(12, 1, 12, "Row"),
102+
@TK::TkNL .new(15, 1, 15, "\n"),
103+
]
104+
105+
assert_equal expected, tokens
106+
end
107+
93108
def test_class_tokenize_heredoc_CR_NL
94109
tokens = RDoc::RubyLex.tokenize <<-RUBY, nil
95110
string = <<-STRING\r

0 commit comments

Comments
 (0)