Skip to content

Commit fc22e97

Browse files
committed
Add test_class_tokenize_number_with_sign_character
1 parent 8f7742f commit fc22e97

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/test_rdoc_ruby_lex.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,19 @@ def test_class_tokenize_regexp_escape
339339
assert_equal expected, tokens
340340
end
341341

342+
def test_class_tokenize_number_with_sign_character
343+
tokens = RDoc::RubyLex.tokenize "+3--3r", nil
344+
345+
expected = [
346+
@TK::TkINTEGER .new(0, 1, 0, "+3"),
347+
@TK::TkMINUS .new(2, 1, 2, "-"),
348+
@TK::TkRATIONAL.new(3, 1, 3, "-3r"),
349+
@TK::TkNL .new(6, 1, 6, "\n"),
350+
]
351+
352+
assert_equal expected, tokens
353+
end
354+
342355
def test_class_tokenize_string
343356
tokens = RDoc::RubyLex.tokenize "'hi'", nil
344357

0 commit comments

Comments
 (0)