Test multi-line strings in interpolation (#789)
The behavior here is strange, and unintentional, but not obviously wrong. Add a test to make sure I don't accidentally break it in the future.
This commit is contained in:
parent
7a649eb8f6
commit
78b67f6cae
16
src/lexer.rs
16
src/lexer.rs
@ -1431,6 +1431,22 @@ mod tests {
|
||||
),
|
||||
}
|
||||
|
||||
test! {
|
||||
name: interpolation_raw_multiline_string,
|
||||
text: "hello:\n echo {{'\n'}}",
|
||||
tokens: (
|
||||
Identifier:"hello",
|
||||
Colon,
|
||||
Eol,
|
||||
Indent:" ",
|
||||
Text:"echo ",
|
||||
InterpolationStart,
|
||||
StringRaw:"'\n'",
|
||||
InterpolationEnd,
|
||||
Dedent,
|
||||
),
|
||||
}
|
||||
|
||||
test! {
|
||||
name: tokenize_names,
|
||||
text: "
|
||||
|
@ -2452,6 +2452,19 @@ test! {
|
||||
",
|
||||
}
|
||||
|
||||
test! {
|
||||
name: multi_line_string_in_interpolation,
|
||||
justfile: "
|
||||
foo:
|
||||
echo {{'a
|
||||
echo b
|
||||
echo c'}}z
|
||||
echo baz
|
||||
",
|
||||
stdout: "a\nb\ncz\nbaz\n",
|
||||
stderr: "echo a\n echo b\n echo cz\necho baz\n",
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
test! {
|
||||
name: windows_interpreter_path_no_base,
|
||||
|
Loading…
Reference in New Issue
Block a user