Skip to content

Commit cb349b1

Browse files
committed
Add test_class_tokenize_regexp_continuing_backslash
1 parent e2e70b7 commit cb349b1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test_rdoc_ruby_lex.rb

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

342+
def test_class_tokenize_regexp_continuing_backslash
343+
tokens = RDoc::RubyLex.tokenize "/(?<!\\\\)\\n\z/", nil
344+
345+
expected = [
346+
@TK::TkREGEXP.new( 0, 1, 0, "/(?<!\\\\)\\n\z/"),
347+
@TK::TkNL .new(12, 1, 12, "\n"),
348+
]
349+
350+
assert_equal expected, tokens
351+
end
352+
342353
def test_class_tokenize_string
343354
tokens = RDoc::RubyLex.tokenize "'hi'", nil
344355

0 commit comments

Comments
 (0)