mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 14:34:39 +02:00
parent
2a8d9c59ff
commit
ec83bd7356
2 changed files with 53 additions and 16 deletions
|
@ -103,6 +103,18 @@ module Prism
|
|||
assert_equal 7, location.end_character_column
|
||||
end
|
||||
|
||||
def test_heredoc?
|
||||
refute parse_expression("\"foo\"").heredoc?
|
||||
refute parse_expression("\"foo \#{1}\"").heredoc?
|
||||
refute parse_expression("`foo`").heredoc?
|
||||
refute parse_expression("`foo \#{1}`").heredoc?
|
||||
|
||||
assert parse_expression("<<~HERE\nfoo\nHERE\n").heredoc?
|
||||
assert parse_expression("<<~HERE\nfoo \#{1}\nHERE\n").heredoc?
|
||||
assert parse_expression("<<~`HERE`\nfoo\nHERE\n").heredoc?
|
||||
assert parse_expression("<<~`HERE`\nfoo \#{1}\nHERE\n").heredoc?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def parse_expression(source)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue