Use box-drawing characters in error messages (#1798)

This commit is contained in:
Casey Rodarmor 2023-12-29 13:25:30 -08:00 committed by GitHub
parent e2c0d86bdd
commit b188882ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 506 additions and 507 deletions

View File

@ -2311,10 +2311,10 @@ mod tests {
.to_string(), .to_string(),
"error: Internal error, this may indicate a bug in just: Lexer presumed character `-` "error: Internal error, this may indicate a bug in just: Lexer presumed character `-`
consider filing an issue: https://github.com/casey/just/issues/new consider filing an issue: https://github.com/casey/just/issues/new
--> justfile:1:1 justfile:1:1
|
1 | ! 1 !
| ^" ^"
); );
} }
} }

View File

@ -57,7 +57,7 @@ impl<'src> ColorDisplay for Token<'src> {
f, f,
"{:width$}{} {}:{}:{}", "{:width$}{} {}:{}:{}",
"", "",
color.context().paint("-->"), color.context().paint("——▶"),
self.path.display(), self.path.display(),
line_number, line_number,
self.column.ordinal(), self.column.ordinal(),
@ -67,19 +67,19 @@ impl<'src> ColorDisplay for Token<'src> {
f, f,
"{:width$} {}", "{:width$} {}",
"", "",
color.context().paint("|"), color.context().paint(""),
width = line_number_width width = line_number_width
)?; )?;
writeln!( writeln!(
f, f,
"{} {space_line}", "{} {space_line}",
color.context().paint(&format!("{line_number} |")) color.context().paint(&format!("{line_number} "))
)?; )?;
write!( write!(
f, f,
"{:width$} {}", "{:width$} {}",
"", "",
color.context().paint("|"), color.context().paint(""),
width = line_number_width width = line_number_width
)?; )?;
write!( write!(

View File

@ -33,10 +33,10 @@ fn duplicate_attributes_are_disallowed() {
.stderr( .stderr(
" "
error: Recipe attribute `no-exit-message` first used on line 1 is duplicated on line 2 error: Recipe attribute `no-exit-message` first used on line 1 is duplicated on line 2
--> justfile:2:2 justfile:2:2
|
2 | [no-exit-message] 2 [no-exit-message]
| ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
", ",
) )
.status(1) .status(1)
@ -73,10 +73,10 @@ fn multiple_attributes_one_line_error_message() {
.stderr( .stderr(
" "
error: Expected ']' or ',', but found identifier error: Expected ']' or ',', but found identifier
--> justfile:1:17 justfile:1:17
|
1 | [macos, windows linux] 1 [macos, windows linux]
| ^^^^^ ^^^^^
", ",
) )
.status(1) .status(1)
@ -97,10 +97,10 @@ fn multiple_attributes_one_line_duplicate_check() {
.stderr( .stderr(
" "
error: Recipe attribute `linux` first used on line 1 is duplicated on line 2 error: Recipe attribute `linux` first used on line 1 is duplicated on line 2
--> justfile:2:2 justfile:2:2
|
2 | [linux] 2 [linux]
| ^^^^^ ^^^^^
", ",
) )
.status(1) .status(1)

View File

@ -27,10 +27,10 @@ fn non_leading_byte_order_mark_produces_error() {
.stderr( .stderr(
" "
error: Expected \'@\', \'[\', comment, end of file, end of line, or identifier, but found byte order mark error: Expected \'@\', \'[\', comment, end of file, end of line, or identifier, but found byte order mark
--> justfile:3:1 justfile:3:1
|
3 | \u{feff} 3 \u{feff}
| ^ ^
") ")
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
.run(); .run();
@ -43,10 +43,10 @@ fn dont_mention_byte_order_mark_in_errors() {
.stderr( .stderr(
" "
error: Expected '@', '[', comment, end of file, end of line, or identifier, but found '{' error: Expected '@', '[', comment, end of file, end of line, or identifier, but found '{'
--> justfile:1:1 justfile:1:1
|
1 | { 1 {
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)

View File

@ -61,10 +61,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Variable `b` not defined error: Variable `b` not defined
--> justfile:1:9 justfile:1:9
|
1 | a := if b == '' { '' } else { '' } 1 a := if b == '' { '' } else { '' }
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -80,10 +80,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Variable `b` not defined error: Variable `b` not defined
--> justfile:1:15 justfile:1:15
|
1 | a := if '' == b { '' } else { '' } 1 a := if '' == b { '' } else { '' }
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -99,10 +99,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Variable `b` not defined error: Variable `b` not defined
--> justfile:1:20 justfile:1:20
|
1 | a := if '' == '' { b } else { '' } 1 a := if '' == '' { b } else { '' }
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -118,10 +118,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Variable `b` not defined error: Variable `b` not defined
--> justfile:1:32 justfile:1:32
|
1 | a := if '' == '' { '' } else { b } 1 a := if '' == '' { '' } else { b }
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -137,10 +137,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Expected '!=', '==', '=~', '+', or '/', but found identifier error: Expected '!=', '==', '=~', '+', or '/', but found identifier
--> justfile:1:12 justfile:1:12
|
1 | a := if '' a '' { '' } else { b } 1 a := if '' a '' { '' } else { b }
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -182,10 +182,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Expected keyword `else` but found `end of line` error: Expected keyword `else` but found `end of line`
--> justfile:1:54 justfile:1:54
|
1 | TEST := if path_exists('/bin/bash') == 'true' {'yes'} 1 TEST := if path_exists('/bin/bash') == 'true' {'yes'}
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -198,10 +198,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Expected keyword `else` but found identifier `els` error: Expected keyword `else` but found identifier `els`
--> justfile:1:55 justfile:1:55
|
1 | TEST := if path_exists('/bin/bash') == 'true' {'yes'} els {'no'} 1 TEST := if path_exists('/bin/bash') == 'true' {'yes'} els {'no'}
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }

View File

@ -5,10 +5,10 @@ test! {
justfile: "(]", justfile: "(]",
stderr: " stderr: "
error: Mismatched closing delimiter `]`. (Did you mean to close the `(` on line 1?) error: Mismatched closing delimiter `]`. (Did you mean to close the `(` on line 1?)
--> justfile:1:2 justfile:1:2
|
1 | (] 1 (]
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -18,10 +18,10 @@ test! {
justfile: "]", justfile: "]",
stderr: " stderr: "
error: Unexpected closing delimiter `]` error: Unexpected closing delimiter `]`
--> justfile:1:1 justfile:1:1
|
1 | ] 1 ]
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -98,10 +98,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Unterminated interpolation error: Unterminated interpolation
--> justfile:2:8 justfile:2:8
|
2 | echo {{ ( 2 echo {{ (
| ^^ ^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }

View File

@ -5,10 +5,10 @@ test! {
justfile: "[private]\n[linux]\nalias t := test\n\ntest:\n", justfile: "[private]\n[linux]\nalias t := test\n\ntest:\n",
stderr: " stderr: "
error: Alias t has an invalid attribute `linux` error: Alias t has an invalid attribute `linux`
--> justfile:3:7 justfile:3:7
|
3 | alias t := test 3 alias t := test
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -18,10 +18,10 @@ test! {
justfile: "foo := if '' == '' { '' } arlo { '' }", justfile: "foo := if '' == '' { '' } arlo { '' }",
stderr: " stderr: "
error: Expected keyword `else` but found identifier `arlo` error: Expected keyword `else` but found identifier `arlo`
--> justfile:1:27 justfile:1:27
|
1 | foo := if '' == '' { '' } arlo { '' } 1 foo := if '' == '' { '' } arlo { '' }
| ^^^^ ^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -31,10 +31,10 @@ test! {
justfile: "&~", justfile: "&~",
stderr: " stderr: "
error: Expected character `&` error: Expected character `&`
--> justfile:1:2 justfile:1:2
|
1 | &~ 1 &~
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -63,10 +63,10 @@ fn file_path_is_indented_if_justfile_is_long() {
.stderr( .stderr(
" "
error: Expected '*', ':', '$', identifier, or '+', but found end of file error: Expected '*', ':', '$', identifier, or '+', but found end of file
--> justfile:20:4 justfile:20:4
|
20 | foo 20 foo
| ^ ^
", ",
) )
.run(); .run();
@ -81,10 +81,10 @@ fn file_paths_are_relative() {
.stderr(format!( .stderr(format!(
" "
error: Expected '*', ':', '$', identifier, or '+', but found end of file error: Expected '*', ':', '$', identifier, or '+', but found end of file
--> foo{}bar.just:1:4 foo{}bar.just:1:4
|
1 | baz 1 baz
| ^ ^
", ",
MAIN_SEPARATOR MAIN_SEPARATOR
)) ))
@ -92,6 +92,7 @@ error: Expected '*', ':', '$', identifier, or '+', but found end of file
} }
#[test] #[test]
#[cfg(not(windows))]
fn file_paths_not_in_subdir_are_absolute() { fn file_paths_not_in_subdir_are_absolute() {
Test::new() Test::new()
.write("foo/justfile", "import '../bar.just'") .write("foo/justfile", "import '../bar.just'")
@ -99,15 +100,13 @@ fn file_paths_not_in_subdir_are_absolute() {
.no_justfile() .no_justfile()
.args(["--justfile", "foo/justfile"]) .args(["--justfile", "foo/justfile"])
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
.stderr_regex(format!( .stderr_regex(
" r"error: Expected '\*', ':', '\$', identifier, or '\+', but found end of file
error: Expected '*', ':', '$', identifier, or '+', but found end of file /.*/bar.just:1:4
--> {}.*{}bar.just:1:4
| 1 baz
1 | baz \^
| ^
", ",
MAIN_SEPARATOR, MAIN_SEPARATOR )
))
.run(); .run();
} }

View File

@ -146,10 +146,10 @@ fn print_error_from_parent_if_recipe_not_found_in_current() {
.stderr( .stderr(
" "
error: Variable `bar` not defined error: Variable `bar` not defined
--> justfile:2:9 justfile:2:9
|
2 | echo {{bar}} 2 echo {{bar}}
| ^^^ ^^^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)

View File

@ -88,10 +88,10 @@ foo:
stderr: format!("{} {}\n{}\n{}\n{}\n{}\n", stderr: format!("{} {}\n{}\n{}\n{}\n{}\n",
"error: Call to function `without_extension` failed:", "error: Call to function `without_extension` failed:",
"Could not extract parent from ``", "Could not extract parent from ``",
" --> justfile:1:8", " ——▶ justfile:1:8",
" |", " ",
"1 | we := without_extension(\'\')", "1 we := without_extension(\'\')",
" | ^^^^^^^^^^^^^^^^^").as_str(), " ^^^^^^^^^^^^^^^^^").as_str(),
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -107,10 +107,10 @@ foo:
stdout: "", stdout: "",
stderr: format!("{}\n{}\n{}\n{}\n{}\n", stderr: format!("{}\n{}\n{}\n{}\n{}\n",
"error: Call to function `extension` failed: Could not extract extension from ``", "error: Call to function `extension` failed: Could not extract extension from ``",
" --> justfile:1:8", " ——▶ justfile:1:8",
" |", " ",
"1 | we := extension(\'\')", "1 we := extension(\'\')",
" | ^^^^^^^^^").as_str(), " ^^^^^^^^^").as_str(),
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -126,10 +126,10 @@ foo:
stdout: "", stdout: "",
stderr: format!("{}\n{}\n{}\n{}\n{}\n", stderr: format!("{}\n{}\n{}\n{}\n{}\n",
"error: Call to function `extension` failed: Could not extract extension from `foo`", "error: Call to function `extension` failed: Could not extract extension from `foo`",
" --> justfile:1:8", " ——▶ justfile:1:8",
" |", " ",
"1 | we := extension(\'foo\')", "1 we := extension(\'foo\')",
" | ^^^^^^^^^").as_str(), " ^^^^^^^^^").as_str(),
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -145,10 +145,10 @@ foo:
stdout: "", stdout: "",
stderr: format!("{}\n{}\n{}\n{}\n{}\n", stderr: format!("{}\n{}\n{}\n{}\n{}\n",
"error: Call to function `file_stem` failed: Could not extract file stem from ``", "error: Call to function `file_stem` failed: Could not extract file stem from ``",
" --> justfile:1:8", " ——▶ justfile:1:8",
" |", " ",
"1 | we := file_stem(\'\')", "1 we := file_stem(\'\')",
" | ^^^^^^^^^").as_str(), " ^^^^^^^^^").as_str(),
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -164,10 +164,10 @@ foo:
stdout: "", stdout: "",
stderr: format!("{}\n{}\n{}\n{}\n{}\n", stderr: format!("{}\n{}\n{}\n{}\n{}\n",
"error: Call to function `file_name` failed: Could not extract file name from ``", "error: Call to function `file_name` failed: Could not extract file name from ``",
" --> justfile:1:8", " ——▶ justfile:1:8",
" |", " ",
"1 | we := file_name(\'\')", "1 we := file_name(\'\')",
" | ^^^^^^^^^").as_str(), " ^^^^^^^^^").as_str(),
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -184,10 +184,10 @@ foo:
stderr: format!("{} {}\n{}\n{}\n{}\n{}\n", stderr: format!("{} {}\n{}\n{}\n{}\n{}\n",
"error: Call to function `parent_directory` failed:", "error: Call to function `parent_directory` failed:",
"Could not extract parent directory from ``", "Could not extract parent directory from ``",
" --> justfile:1:8", " ——▶ justfile:1:8",
" |", " ",
"1 | we := parent_directory(\'\')", "1 we := parent_directory(\'\')",
" | ^^^^^^^^^^^^^^^^").as_str(), " ^^^^^^^^^^^^^^^^").as_str(),
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -204,10 +204,10 @@ foo:
stderr: format!("{} {}\n{}\n{}\n{}\n{}\n", stderr: format!("{} {}\n{}\n{}\n{}\n{}\n",
"error: Call to function `parent_directory` failed:", "error: Call to function `parent_directory` failed:",
"Could not extract parent directory from `/`", "Could not extract parent directory from `/`",
" --> justfile:1:8", " ——▶ justfile:1:8",
" |", " ",
"1 | we := parent_directory(\'/\')", "1 we := parent_directory(\'/\')",
" | ^^^^^^^^^^^^^^^^").as_str(), " ^^^^^^^^^^^^^^^^").as_str(),
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -232,10 +232,10 @@ test! {
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Call to function `env_var` failed: environment variable `ZADDY` not present stderr: "error: Call to function `env_var` failed: environment variable `ZADDY` not present
--> justfile:2:10 justfile:2:10
|
2 | echo {{env_var('ZADDY')}} 2 echo {{env_var('ZADDY')}}
| ^^^^^^^ ^^^^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -403,10 +403,10 @@ test! {
foo\\ foo\\
^ ^
error: incomplete escape sequence, reached end of pattern prematurely error: incomplete escape sequence, reached end of pattern prematurely
--> justfile:2:11 justfile:2:11
|
2 | echo {{ replace_regex('barbarbar', 'foo\\', 'foo') }} 2 echo {{ replace_regex('barbarbar', 'foo\\', 'foo') }}
| ^^^^^^^^^^^^^ ^^^^^^^^^^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -507,10 +507,10 @@ fn join_argument_count_error() {
.stderr( .stderr(
" "
error: Function `join` called with 1 argument but takes 2 or more error: Function `join` called with 1 argument but takes 2 or more
--> justfile:1:6 justfile:1:6
|
1 | x := join(\'a\') 1 x := join(\'a\')
| ^^^^ ^^^^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
@ -547,10 +547,10 @@ fn error_errors_with_message() {
.stderr( .stderr(
" "
error: Call to function `error` failed: Thing Not Supported error: Call to function `error` failed: Thing Not Supported
--> justfile:1:6 justfile:1:6
|
1 | x := error ('Thing Not Supported') 1 x := error ('Thing Not Supported')
| ^^^^^ ^^^^^
", ",
) )
.run(); .run();

View File

@ -40,10 +40,10 @@ fn missing_import_file_error() {
.stderr( .stderr(
" "
error: Could not find source file for import. error: Could not find source file for import.
--> justfile:1:8 justfile:1:8
|
1 | import './import.justfile' 1 import './import.justfile'
| ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
", ",
) )
.run(); .run();
@ -162,10 +162,10 @@ fn include_error() {
.stderr( .stderr(
" "
error: The `!include` directive has been stabilized as `import` error: The `!include` directive has been stabilized as `import`
--> justfile:1:1 justfile:1:1
|
1 | !include foo 1 !include foo
| ^ ^
", ",
) )
.run(); .run();

View File

@ -72,10 +72,10 @@ test! {
", ",
stderr: " stderr: "
error: Unknown setting `foo` error: Unknown setting `foo`
--> justfile:1:5 justfile:1:5
|
1 | set foo 1 set foo
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -87,10 +87,10 @@ test! {
", ",
stderr: " stderr: "
error: Unknown setting `if` error: Unknown setting `if`
--> justfile:1:5 justfile:1:5
|
1 | set if := 'foo' 1 set if := 'foo'
| ^^ ^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -108,10 +108,10 @@ test! {
justfile: "alias foo := bar\nalias foo := baz\n", justfile: "alias foo := bar\nalias foo := baz\n",
stderr: " stderr: "
error: Alias `foo` first defined on line 1 is redefined on line 2 error: Alias `foo` first defined on line 1 is redefined on line 2
--> justfile:2:7 justfile:2:7
|
2 | alias foo := baz 2 alias foo := baz
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -121,10 +121,10 @@ test! {
justfile: "alias foo := bar\n", justfile: "alias foo := bar\n",
stderr: " stderr: "
error: Alias `foo` has an unknown target `bar` error: Alias `foo` has an unknown target `bar`
--> justfile:1:7 justfile:1:7
|
1 | alias foo := bar 1 alias foo := bar
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -134,10 +134,10 @@ test! {
justfile: "bar:\n echo bar\nalias foo := bar\nfoo:\n echo foo", justfile: "bar:\n echo bar\nalias foo := bar\nfoo:\n echo foo",
stderr: " stderr: "
error: Alias `foo` defined on line 3 is redefined as a recipe on line 4 error: Alias `foo` defined on line 3 is redefined as a recipe on line 4
--> justfile:4:1 justfile:4:1
|
4 | foo: 4 foo:
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -234,10 +234,10 @@ test! {
justfile: "bar:\nhello:\nfoo: bar baaaaaaaz hello", justfile: "bar:\nhello:\nfoo: bar baaaaaaaz hello",
stderr: " stderr: "
error: Recipe `foo` has unknown dependency `baaaaaaaz` error: Recipe `foo` has unknown dependency `baaaaaaaz`
--> justfile:3:10 justfile:3:10
|
3 | foo: bar baaaaaaaz hello 3 foo: bar baaaaaaaz hello
| ^^^^^^^^^ ^^^^^^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -261,10 +261,10 @@ test! {
justfile: "b := a\na := `exit 100`\nbar:\n echo '{{`exit 200`}}'", justfile: "b := a\na := `exit 100`\nbar:\n echo '{{`exit 200`}}'",
stderr: " stderr: "
error: Backtick failed with exit code 100 error: Backtick failed with exit code 100
--> justfile:2:6 justfile:2:6
|
2 | a := `exit 100` 2 a := `exit 100`
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 100, status: 100,
} }
@ -274,10 +274,10 @@ test! {
justfile: "b := a\na := `echo hello`\nbar:\n echo '{{`exit 200`}}'", justfile: "b := a\na := `echo hello`\nbar:\n echo '{{`exit 200`}}'",
stderr: " stderr: "
error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
--> justfile:4:10 justfile:4:10
|
4 | echo '{{`exit 200`}}' 4 echo '{{`exit 200`}}'
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 200, status: 200,
} }
@ -287,10 +287,10 @@ test! {
justfile: "f:\n 無{{`exit 200`}}", justfile: "f:\n 無{{`exit 200`}}",
stderr: " stderr: "
error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
--> justfile:2:7 justfile:2:7
|
2 | {{`exit 200`}} 2 {{`exit 200`}}
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 200, status: 200,
} }
@ -302,10 +302,10 @@ test! {
\techo {{`exit 200`}} \techo {{`exit 200`}}
", ",
stderr: " error: Backtick failed with exit code 200 stderr: " error: Backtick failed with exit code 200
--> justfile:2:9 justfile:2:9
|
2 | echo {{`exit 200`}} 2 echo {{`exit 200`}}
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 200, status: 200,
} }
@ -317,10 +317,10 @@ test! {
\techo {{\t`exit 200`}} \techo {{\t`exit 200`}}
", ",
stderr: "error: Backtick failed with exit code 200 stderr: "error: Backtick failed with exit code 200
--> justfile:2:10 justfile:2:10
|
2 | echo {{ `exit 200`}} 2 echo {{ `exit 200`}}
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 200, status: 200,
} }
@ -333,10 +333,10 @@ test! {
", ",
stderr: " stderr: "
error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
--> justfile:2:10 justfile:2:10
|
2 | echo {{ `exit 200`}} 2 echo {{ `exit 200`}}
| ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
", ",
status: 200, status: 200,
} }
@ -349,10 +349,10 @@ test! {
", ",
stderr: " stderr: "
error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
--> justfile:2:13 justfile:2:13
|
2 | echo 😬{{`exit 200`}} 2 echo 😬{{`exit 200`}}
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 200, status: 200,
} }
@ -365,10 +365,10 @@ test! {
", ",
stderr: " stderr: "
error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
--> justfile:2:24 justfile:2:24
|
2 | echo 😬{{ `exit 200 # abc`}} 😬 2 echo 😬{{ `exit 200 # abc`}} 😬
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
", ",
status: 200, status: 200,
} }
@ -389,10 +389,10 @@ test! {
", ",
stderr: " stderr: "
error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
--> justfile:10:10 justfile:10:10
|
10 | echo '{{`exit 200`}}' 10 echo '{{`exit 200`}}'
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 200, status: 200,
} }
@ -406,10 +406,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Backtick failed with exit code 123 error: Backtick failed with exit code 123
--> justfile:4:9 justfile:4:9
|
4 | echo {{`exit 123`}} 4 echo {{`exit 123`}}
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 123, status: 123,
} }
@ -423,10 +423,10 @@ test! {
stderr: " stderr: "
echo hello echo hello
error: Backtick failed with exit code 123 error: Backtick failed with exit code 123
--> justfile:3:9 justfile:3:9
|
3 | echo {{`exit 123`}} 3 echo {{`exit 123`}}
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 123, status: 123,
} }
@ -440,10 +440,10 @@ a := `exit 222`",
stdout: "", stdout: "",
stderr: " stderr: "
error: Backtick failed with exit code 222 error: Backtick failed with exit code 222
--> justfile:4:6 justfile:4:6
|
4 | a := `exit 222` 4 a := `exit 222`
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 222, status: 222,
} }
@ -556,10 +556,10 @@ test! {
"#, "#,
stdout: "", stdout: "",
stderr: "error: Unknown start of token: stderr: "error: Unknown start of token:
--> justfile:10:1 justfile:10:1
|
10 | ^^^ 10 ^^^
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -661,7 +661,7 @@ test! {
justfile: "b := a\na := `exit 100`\nbar:\n echo '{{`exit 200`}}'", justfile: "b := a\na := `exit 100`\nbar:\n echo '{{`exit 200`}}'",
args: ("--color", "always"), args: ("--color", "always"),
stdout: "", stdout: "",
stderr: "\u{1b}[1;31merror\u{1b}[0m: \u{1b}[1mBacktick failed with exit code 100\u{1b}[0m\n \u{1b}[1;34m-->\u{1b}[0m justfile:2:6\n \u{1b}[1;34m|\u{1b}[0m\n\u{1b}[1;34m2 |\u{1b}[0m a := `exit 100`\n \u{1b}[1;34m|\u{1b}[0m \u{1b}[1;31m^^^^^^^^^^\u{1b}[0m\n", stderr: "\u{1b}[1;31merror\u{1b}[0m: \u{1b}[1mBacktick failed with exit code 100\u{1b}[0m\n \u{1b}[1;34m——▶\u{1b}[0m justfile:2:6\n \u{1b}[1;34m│\u{1b}[0m\n\u{1b}[1;34m2 │\u{1b}[0m a := `exit 100`\n \u{1b}[1;34m│\u{1b}[0m \u{1b}[1;31m^^^^^^^^^^\u{1b}[0m\n",
status: 100, status: 100,
} }
@ -671,10 +671,10 @@ test! {
args: ("--color", "never"), args: ("--color", "never"),
stdout: "", stdout: "",
stderr: "error: Backtick failed with exit code 100 stderr: "error: Backtick failed with exit code 100
--> justfile:2:6 justfile:2:6
|
2 | a := `exit 100` 2 a := `exit 100`
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 100, status: 100,
} }
@ -685,10 +685,10 @@ test! {
args: ("--color", "auto"), args: ("--color", "auto"),
stdout: "", stdout: "",
stderr: "error: Backtick failed with exit code 100 stderr: "error: Backtick failed with exit code 100
--> justfile:2:6 justfile:2:6
|
2 | a := `exit 100` 2 a := `exit 100`
| ^^^^^^^^^^ ^^^^^^^^^^
", ",
status: 100, status: 100,
} }
@ -724,10 +724,10 @@ test! {
stdout: "", stdout: "",
stderr: "error: Found a mix of tabs and spaces in leading whitespace: `␉␠` stderr: "error: Found a mix of tabs and spaces in leading whitespace: `␉␠`
Leading whitespace may consist of tabs or spaces, but not both Leading whitespace may consist of tabs or spaces, but not both
--> justfile:2:1 justfile:2:1
|
2 | echo hello 2 echo hello
| ^^^^^ ^^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -737,10 +737,10 @@ test! {
justfile: "bar:\n\t\techo hello\n\t\t\techo goodbye", justfile: "bar:\n\t\techo hello\n\t\t\techo goodbye",
stdout: "", stdout: "",
stderr: "error: Recipe line has extra leading whitespace stderr: "error: Recipe line has extra leading whitespace
--> justfile:3:3 justfile:3:3
|
3 | echo goodbye 3 echo goodbye
| ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -751,10 +751,10 @@ test! {
stdout: "", stdout: "",
stderr: "error: Recipe line has inconsistent leading whitespace. \ stderr: "error: Recipe line has inconsistent leading whitespace. \
Recipe started with `` but found line with `` Recipe started with `` but found line with ``
--> justfile:3:1 justfile:3:1
|
3 | echo goodbye 3 echo goodbye
| ^^^^^ ^^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -764,10 +764,10 @@ test! {
justfile: "bar:\nhello baz arg='foo' bar:", justfile: "bar:\nhello baz arg='foo' bar:",
stdout: "", stdout: "",
stderr: "error: Non-default parameter `bar` follows default parameter stderr: "error: Non-default parameter `bar` follows default parameter
--> justfile:2:21 justfile:2:21
|
2 | hello baz arg='foo' bar: 2 hello baz arg='foo' bar:
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -777,10 +777,10 @@ test! {
justfile: "bar:\nhello baz +arg bar:", justfile: "bar:\nhello baz +arg bar:",
stdout: "", stdout: "",
stderr: "error: Parameter `bar` follows variadic parameter stderr: "error: Parameter `bar` follows variadic parameter
--> justfile:2:16 justfile:2:16
|
2 | hello baz +arg bar: 2 hello baz +arg bar:
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -790,10 +790,10 @@ test! {
justfile: "bar:\nhello baz *arg bar:", justfile: "bar:\nhello baz *arg bar:",
stdout: "", stdout: "",
stderr: "error: Parameter `bar` follows variadic parameter stderr: "error: Parameter `bar` follows variadic parameter
--> justfile:2:16 justfile:2:16
|
2 | hello baz *arg bar: 2 hello baz *arg bar:
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1163,10 +1163,10 @@ bar:"#,
args: ("bar"), args: ("bar"),
stdout: "", stdout: "",
stderr: r#"error: Call to unknown function `foo` stderr: r#"error: Call to unknown function `foo`
--> justfile:1:8 justfile:1:8
|
1 | foo := foo() + "hello" 1 foo := foo() + "hello"
| ^^^ ^^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1180,10 +1180,10 @@ test! {
args: ("b"), args: ("b"),
stdout: "", stdout: "",
stderr: "error: Dependency `a` got 0 arguments but takes 1 argument stderr: "error: Dependency `a` got 0 arguments but takes 1 argument
--> justfile:2:4 justfile:2:4
|
2 | b: a 2 b: a
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1197,10 +1197,10 @@ test! {
args: ("b"), args: ("b"),
stdout: "", stdout: "",
stderr: "error: Dependency `a` got 0 arguments but takes at least 1 argument stderr: "error: Dependency `a` got 0 arguments but takes at least 1 argument
--> justfile:2:4 justfile:2:4
|
2 | b: a 2 b: a
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1214,10 +1214,10 @@ test! {
args: ("b"), args: ("b"),
stdout: "", stdout: "",
stderr: "error: Dependency `a` got 3 arguments but takes at most 2 arguments stderr: "error: Dependency `a` got 3 arguments but takes at most 2 arguments
--> justfile:2:5 justfile:2:5
|
2 | b: (a '0' '1' '2') 2 b: (a '0' '1' '2')
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1228,10 +1228,10 @@ test! {
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Recipe `a` has duplicate parameter `foo` stderr: "error: Recipe `a` has duplicate parameter `foo`
--> justfile:1:7 justfile:1:7
|
1 | a foo foo: 1 a foo foo:
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1242,10 +1242,10 @@ test! {
args: ("b"), args: ("b"),
stdout: "", stdout: "",
stderr: "error: Recipe `b` first defined on line 1 is redefined on line 2 stderr: "error: Recipe `b` first defined on line 1 is redefined on line 2
--> justfile:2:1 justfile:2:1
|
2 | b: 2 b:
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1256,10 +1256,10 @@ test! {
args: ("foo"), args: ("foo"),
stdout: "", stdout: "",
stderr: "error: Variable `a` has multiple definitions stderr: "error: Variable `a` has multiple definitions
--> justfile:2:1 justfile:2:1
|
2 | a := 'hello' 2 a := 'hello'
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1271,10 +1271,10 @@ test! {
stdout: "", stdout: "",
stderr: "error: Expected '&&', comment, end of file, end of line, \ stderr: "error: Expected '&&', comment, end of file, end of line, \
identifier, or '(', but found string identifier, or '(', but found string
--> justfile:1:6 justfile:1:6
|
1 | foo: 'bar' 1 foo: 'bar'
| ^^^^^ ^^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1285,10 +1285,10 @@ test! {
args: ("foo"), args: ("foo"),
stdout: "", stdout: "",
stderr: "error: Expected '*', ':', '$', identifier, or '+', but found string stderr: "error: Expected '*', ':', '$', identifier, or '+', but found string
--> justfile:1:5 justfile:1:5
|
1 | foo 'bar' 1 foo 'bar'
| ^^^^^ ^^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1299,10 +1299,10 @@ test! {
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Recipe `a` depends on itself stderr: "error: Recipe `a` depends on itself
--> justfile:1:4 justfile:1:4
|
1 | a: a 1 a: a
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1313,10 +1313,10 @@ test! {
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Recipe `d` has circular dependency `a -> b -> c -> d -> a` stderr: "error: Recipe `d` has circular dependency `a -> b -> c -> d -> a`
--> justfile:4:4 justfile:4:4
|
4 | d: a 4 d: a
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1327,10 +1327,10 @@ test! {
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Variable `z` is defined in terms of itself stderr: "error: Variable `z` is defined in terms of itself
--> justfile:1:1 justfile:1:1
|
1 | z := z 1 z := z
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1341,10 +1341,10 @@ test! {
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Variable `x` depends on its own value: `x -> y -> z -> x` stderr: "error: Variable `x` depends on its own value: `x -> y -> z -> x`
--> justfile:1:1 justfile:1:1
|
1 | x := y 1 x := y
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1361,10 +1361,10 @@ test! {
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Variable `x` depends on its own value: `x -> y -> x` stderr: "error: Variable `x` depends on its own value: `x -> y -> x`
--> justfile:2:1 justfile:2:1
|
2 | x := y 2 x := y
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1466,10 +1466,10 @@ foo *a +b:
", ",
stdout: "", stdout: "",
stderr: "error: Expected \':\' or \'=\', but found \'+\' stderr: "error: Expected \':\' or \'=\', but found \'+\'
--> justfile:1:8 justfile:1:8
|
1 | foo *a +b: 1 foo *a +b:
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1482,10 +1482,10 @@ foo +a *b:
", ",
stdout: "", stdout: "",
stderr: "error: Expected \':\' or \'=\', but found \'*\' stderr: "error: Expected \':\' or \'=\', but found \'*\'
--> justfile:1:8 justfile:1:8
|
1 | foo +a *b: 1 foo +a *b:
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1516,10 +1516,10 @@ a: x y
", ",
stdout: "", stdout: "",
stderr: "error: Recipe `a` has unknown dependency `y` stderr: "error: Recipe `a` has unknown dependency `y`
--> justfile:3:6 justfile:3:6
|
3 | a: x y 3 a: x y
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1674,10 +1674,10 @@ X := "\'"
"#, "#,
stdout: "", stdout: "",
stderr: r#"error: `\'` is not a valid escape sequence stderr: r#"error: `\'` is not a valid escape sequence
--> justfile:1:6 justfile:1:6
|
1 | X := "\'" 1 X := "\'"
| ^^^^ ^^^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1689,10 +1689,10 @@ test! {
", ",
stdout: "", stdout: "",
stderr: r#"error: Variable `bar` not defined stderr: r#"error: Variable `bar` not defined
--> justfile:1:7 justfile:1:7
|
1 | foo x=bar: 1 foo x=bar:
| ^^^ ^^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1704,10 +1704,10 @@ foo x=bar():
", ",
stdout: "", stdout: "",
stderr: r#"error: Call to unknown function `bar` stderr: r#"error: Call to unknown function `bar`
--> justfile:1:7 justfile:1:7
|
1 | foo x=bar(): 1 foo x=bar():
| ^^^ ^^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1761,10 +1761,10 @@ test! {
", ",
stderr: r#" stderr: r#"
error: Unterminated interpolation error: Unterminated interpolation
--> justfile:2:8 justfile:2:8
|
2 | echo {{ 2 echo {{
| ^^ ^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1777,10 +1777,10 @@ test! {
", ",
stderr: r#" stderr: r#"
error: Unterminated interpolation error: Unterminated interpolation
--> justfile:2:8 justfile:2:8
|
2 | echo {{ 2 echo {{
| ^^ ^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1792,10 +1792,10 @@ assembly_source_files = %(wildcard src/arch/$(arch)/*.s)
", ",
stderr: r#" stderr: r#"
error: Unknown start of token: error: Unknown start of token:
--> justfile:1:25 justfile:1:25
|
1 | assembly_source_files = %(wildcard src/arch/$(arch)/*.s) 1 assembly_source_files = %(wildcard src/arch/$(arch)/*.s)
| ^ ^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1891,10 +1891,10 @@ test! {
", ",
stderr: " stderr: "
error: Expected '*', ':', '$', identifier, or '+', but found '=' error: Expected '*', ':', '$', identifier, or '+', but found '='
--> justfile:1:5 justfile:1:5
|
1 | foo = 'bar' 1 foo = 'bar'
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -2089,10 +2089,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Variable `a` not defined error: Variable `a` not defined
--> justfile:3:9 justfile:3:9
|
3 | bar a b=a: 3 bar a b=a:
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
shell: false, shell: false,

View File

@ -163,10 +163,10 @@ fn modules_use_module_settings() {
.stderr( .stderr(
" "
error: Recipe `foo` first defined on line 2 is redefined on line 3 error: Recipe `foo` first defined on line 2 is redefined on line 3
--> foo.just:3:1 foo.just:3:1
|
3 | foo: 3 foo:
| ^^^ ^^^
", ",
) )
.run(); .run();
@ -185,10 +185,10 @@ fn modules_conflict_with_recipes() {
.stderr( .stderr(
" "
error: Module `foo` defined on line 1 is redefined as a recipe on line 2 error: Module `foo` defined on line 1 is redefined as a recipe on line 2
--> justfile:2:1 justfile:2:1
|
2 | foo: 2 foo:
| ^^^ ^^^
", ",
) )
.test_round_trip(false) .test_round_trip(false)
@ -211,10 +211,10 @@ fn modules_conflict_with_aliases() {
.stderr( .stderr(
" "
error: Module `foo` defined on line 1 is redefined as an alias on line 3 error: Module `foo` defined on line 1 is redefined as an alias on line 3
--> justfile:3:7 justfile:3:7
|
3 | alias foo := bar 3 alias foo := bar
| ^^^ ^^^
", ",
) )
.test_round_trip(false) .test_round_trip(false)
@ -240,10 +240,10 @@ fn modules_conflict_with_other_modules() {
.stderr( .stderr(
" "
error: Module `foo` first defined on line 1 is redefined on line 2 error: Module `foo` first defined on line 1 is redefined on line 2
--> justfile:2:5 justfile:2:5
|
2 | mod foo 2 mod foo
| ^^^ ^^^
", ",
) )
.arg("--unstable") .arg("--unstable")
@ -366,10 +366,10 @@ fn modules_require_unambiguous_file() {
.stderr( .stderr(
" "
error: Found multiple source files for module `foo`: `foo.just` and `foo/justfile` error: Found multiple source files for module `foo`: `foo.just` and `foo/justfile`
--> justfile:1:5 justfile:1:5
|
1 | mod foo 1 mod foo
| ^^^ ^^^
", ",
) )
.run(); .run();
@ -389,10 +389,10 @@ fn missing_module_file_error() {
.stderr( .stderr(
" "
error: Could not find source file for module `foo`. error: Could not find source file for module `foo`.
--> justfile:1:5 justfile:1:5
|
1 | mod foo 1 mod foo
| ^^^ ^^^
", ",
) )
.run(); .run();

View File

@ -72,10 +72,10 @@ fn newline_escape_deps_invalid_esc() {
.stderr( .stderr(
" "
error: `\\ ` is not a valid escape sequence error: `\\ ` is not a valid escape sequence
--> justfile:1:11 justfile:1:11
|
1 | default: a\\ b 1 default: a\\ b
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
@ -93,10 +93,10 @@ fn newline_escape_unpaired_linefeed() {
.stderr( .stderr(
" "
error: Unpaired carriage return error: Unpaired carriage return
--> justfile:1:9 justfile:1:9
|
1 | default:\\\ra 1 default:\\\ra
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)

View File

@ -53,10 +53,10 @@ hello:
"#, "#,
stderr: r#" stderr: r#"
error: Unknown attribute `unknown-attribute` error: Unknown attribute `unknown-attribute`
--> justfile:2:2 justfile:2:2
|
2 | [unknown-attribute] 2 [unknown-attribute]
| ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -71,10 +71,10 @@ hello:
"#, "#,
stderr: r#" stderr: r#"
error: Expected identifier, but found ']' error: Expected identifier, but found ']'
--> justfile:2:2 justfile:2:2
|
2 | [] 2 []
| ^ ^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -89,10 +89,10 @@ hello:
"#, "#,
stderr: r#" stderr: r#"
error: Expected '@', '[', or identifier, but found comment error: Expected '@', '[', or identifier, but found comment
--> justfile:2:1 justfile:2:1
|
2 | # This is a doc comment 2 # This is a doc comment
| ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
@ -106,7 +106,7 @@ test! {
hello: hello:
@exit 100 @exit 100
"#, "#,
stderr: "error: Expected '@', '[', or identifier, but found end of line\n --> justfile:2:1\n |\n2 | \n | ^\n", stderr: "error: Expected '@', '[', or identifier, but found end of line\n ——▶ justfile:2:1\n\n2 │ \n ^\n",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }

View File

@ -16,17 +16,17 @@ fn bugfix() {
#[cfg(not(windows))] #[cfg(not(windows))]
const RECURSION_LIMIT_REACHED: &str = " const RECURSION_LIMIT_REACHED: &str = "
error: Parsing recursion depth exceeded error: Parsing recursion depth exceeded
--> justfile:1:265 justfile:1:265
|
1 | foo: (x (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 1 foo: (x ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
| ^ ^
"; ";
#[cfg(windows)] #[cfg(windows)]
const RECURSION_LIMIT_REACHED: &str = " const RECURSION_LIMIT_REACHED: &str = "
error: Parsing recursion depth exceeded error: Parsing recursion depth exceeded
--> justfile:1:57 justfile:1:57
|
1 | foo: (x (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 1 foo: (x ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
| ^ ^
"; ";

View File

@ -30,10 +30,10 @@ test! {
args: ("--show", "f"), args: ("--show", "f"),
stderr: " stderr: "
error: Alias `f` has an unknown target `foo` error: Alias `f` has an unknown target `foo`
--> justfile:1:7 justfile:1:7
|
1 | alias f := foo 1 alias f := foo
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }

View File

@ -48,10 +48,10 @@ fn no_rhs_once() {
.stderr( .stderr(
" "
error: Expected backtick, identifier, '(', '/', or string, but found end of file error: Expected backtick, identifier, '(', '/', or string, but found end of file
--> justfile:1:11 justfile:1:11
|
1 | x := 'a' / 1 x := 'a' /
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
@ -70,10 +70,10 @@ fn default_un_parenthesized() {
.stderr( .stderr(
" "
error: Expected '*', ':', '$', identifier, or '+', but found '/' error: Expected '*', ':', '$', identifier, or '+', but found '/'
--> justfile:1:11 justfile:1:11
|
1 | foo x='a' / 'b': 1 foo x='a' / 'b':
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
@ -92,10 +92,10 @@ fn no_lhs_un_parenthesized() {
.stderr( .stderr(
" "
error: Expected backtick, identifier, '(', or string, but found '/' error: Expected backtick, identifier, '(', or string, but found '/'
--> justfile:1:7 justfile:1:7
|
1 | foo x=/ 'a' / 'b': 1 foo x=/ 'a' / 'b':
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)

View File

@ -88,10 +88,10 @@ a:"#,
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: `\\q` is not a valid escape sequence stderr: "error: `\\q` is not a valid escape sequence
--> justfile:1:6 justfile:1:6
|
1 | x := \"\\q\" 1 x := \"\\q\"
| ^^^^ ^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -109,10 +109,10 @@ a:
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Variable `foo` not defined stderr: "error: Variable `foo` not defined
--> justfile:6:11 justfile:6:11
|
6 | echo '{{foo}}' 6 echo '{{foo}}'
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -130,10 +130,10 @@ a:
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Variable `bar` not defined stderr: "error: Variable `bar` not defined
--> justfile:3:13 justfile:3:13
|
3 | whatever' + bar 3 whatever' + bar
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -168,10 +168,10 @@ a:
args: ("a"), args: ("a"),
stdout: "", stdout: "",
stderr: "error: Variable `b` not defined stderr: "error: Variable `b` not defined
--> justfile:5:10 justfile:5:10
|
5 | echo {{b}} 5 echo {{b}}
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -185,10 +185,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Unterminated string error: Unterminated string
--> justfile:1:6 justfile:1:6
|
1 | a b= ': 1 a b= ':
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -202,10 +202,10 @@ test! {
stdout: "", stdout: "",
stderr: r#" stderr: r#"
error: Unterminated string error: Unterminated string
--> justfile:1:6 justfile:1:6
|
1 | a b= ": 1 a b= ":
| ^ ^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -218,10 +218,10 @@ test! {
", ",
stderr: r#" stderr: r#"
error: Unterminated backtick error: Unterminated backtick
--> justfile:1:8 justfile:1:8
|
1 | foo a= `echo blaaaaaah: 1 foo a= `echo blaaaaaah:
| ^ ^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -235,10 +235,10 @@ test! {
stdout: "", stdout: "",
stderr: " stderr: "
error: Unterminated string error: Unterminated string
--> justfile:1:6 justfile:1:6
|
1 | a b= ''': 1 a b= ''':
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -252,10 +252,10 @@ test! {
stdout: "", stdout: "",
stderr: r#" stderr: r#"
error: Unterminated string error: Unterminated string
--> justfile:1:6 justfile:1:6
|
1 | a b= """: 1 a b= """:
| ^^^ ^^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -268,10 +268,10 @@ test! {
", ",
stderr: r#" stderr: r#"
error: Unterminated backtick error: Unterminated backtick
--> justfile:1:8 justfile:1:8
|
1 | foo a= ```echo blaaaaaah: 1 foo a= ```echo blaaaaaah:
| ^^^ ^^^
"#, "#,
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -384,10 +384,10 @@ test! {
", ",
stderr: " stderr: "
error: Backticks may not start with `#!` error: Backticks may not start with `#!`
--> justfile:1:6 justfile:1:6
|
1 | x := `#!/usr/bin/env sh` 1 x := `#!/usr/bin/env sh`
| ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }

View File

@ -47,10 +47,10 @@ test! {
", ",
stderr: " stderr: "
error: Recipe `foo` depends on itself error: Recipe `foo` depends on itself
--> justfile:1:9 justfile:1:9
|
1 | foo: && foo 1 foo: && foo
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -62,10 +62,10 @@ test! {
", ",
stderr: " stderr: "
error: Recipe `foo` has unknown dependency `bar` error: Recipe `foo` has unknown dependency `bar`
--> justfile:1:9 justfile:1:9
|
1 | foo: && bar 1 foo: && bar
| ^^^ ^^^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -79,10 +79,10 @@ test! {
", ",
stderr: " stderr: "
error: Variable `y` not defined error: Variable `y` not defined
--> justfile:3:14 justfile:3:14
|
3 | foo: && (bar y) 3 foo: && (bar y)
| ^ ^
", ",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }

View File

@ -7,10 +7,10 @@ fn parameter_default_unknown_variable_in_expression() {
.stderr( .stderr(
" "
error: Variable `b` not defined error: Variable `b` not defined
--> justfile:1:8 justfile:1:8
|
1 | foo a=(b+''): 1 foo a=(b+''):
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
@ -28,10 +28,10 @@ fn unknown_variable_in_unary_call() {
.stderr( .stderr(
" "
error: Variable `a` not defined error: Variable `a` not defined
--> justfile:1:15 justfile:1:15
|
1 | foo x=env_var(a): 1 foo x=env_var(a):
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
@ -49,10 +49,10 @@ fn unknown_first_variable_in_binary_call() {
.stderr( .stderr(
" "
error: Variable `a` not defined error: Variable `a` not defined
--> justfile:1:26 justfile:1:26
|
1 | foo x=env_var_or_default(a, b): 1 foo x=env_var_or_default(a, b):
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
@ -70,10 +70,10 @@ fn unknown_second_variable_in_binary_call() {
.stderr( .stderr(
" "
error: Variable `b` not defined error: Variable `b` not defined
--> justfile:1:30 justfile:1:30
|
1 | foo x=env_var_or_default('', b): 1 foo x=env_var_or_default('', b):
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
@ -91,10 +91,10 @@ fn unknown_variable_in_ternary_call() {
.stderr( .stderr(
" "
error: Variable `a` not defined error: Variable `a` not defined
--> justfile:1:15 justfile:1:15
|
1 | foo x=replace(a, b, c): 1 foo x=replace(a, b, c):
| ^ ^
", ",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)