Skip to content

Commit e2fa6a8

Browse files
committed
Fix test_parse_statements_def_percent_string_pound for dynamic string handling
1 parent 57a5cec commit e2fa6a8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/test_rdoc_parser_ruby.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,7 +2063,7 @@ def test_parse_statements_class_nested
20632063
end
20642064

20652065
def test_parse_statements_def_percent_string_pound
2066-
util_parser "class C\ndef a\n%r{#}\nend\ndef b() end\nend"
2066+
util_parser "class C\ndef a\n%r{#}\n%r{\#{}}\nend\ndef b() end\nend"
20672067

20682068
@parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL
20692069

@@ -2080,9 +2080,11 @@ def test_parse_statements_def_percent_string_pound
20802080
tk(:SPACE, 11, 2, 3, nil, ' '),
20812081
tk(:IDENTIFIER, 12, 2, 4, 'a', 'a'),
20822082
tk(:NL, 13, 2, 5, nil, "\n"),
2083-
tk(:DREGEXP, 14, 3, 0, nil, '%r{#}'),
2083+
tk(:REGEXP, 14, 3, 0, nil, '%r{#}'),
20842084
tk(:NL, 19, 3, 5, nil, "\n"),
2085-
tk(:END, 20, 4, 0, 'end', 'end'),
2085+
tk(:DREGEXP, 20, 4, 0, nil, '%r{#{}}'),
2086+
tk(:NL, 27, 4, 7, nil, "\n"),
2087+
tk(:END, 28, 5, 0, 'end', 'end'),
20862088
]
20872089

20882090
assert_equal expected, a.token_stream

0 commit comments

Comments
 (0)