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:
Casey Rodarmor 2021-04-03 19:59:13 -07:00 committed by GitHub
parent 7a649eb8f6
commit 78b67f6cae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 0 deletions

View File

@ -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! { test! {
name: tokenize_names, name: tokenize_names,
text: " text: "

View File

@ -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)] #[cfg(windows)]
test! { test! {
name: windows_interpreter_path_no_base, name: windows_interpreter_path_no_base,