Use more indented strings in integration tests (#489)

Changes by @aquarhead, but git merge clobbered original authorship.
This commit is contained in:
Casey Rodarmor 2019-10-08 22:52:51 -07:00
parent 5da0079ad9
commit 64ed94c8ac
No known key found for this signature in database
GPG Key ID: C7A7A5DE35A721D3

View File

@ -238,8 +238,8 @@ integration_test! {
integration_test! { integration_test! {
name: duplicate_alias, name: duplicate_alias,
justfile: "alias foo := bar\nalias foo := baz\n", justfile: "alias foo := bar\nalias foo := baz\n",
stdout: "" , 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`
| |
2 | alias foo := baz 2 | alias foo := baz
| ^^^ | ^^^
@ -250,8 +250,8 @@ integration_test! {
integration_test! { integration_test! {
name: unknown_alias_target, name: unknown_alias_target,
justfile: "alias foo := bar\n", justfile: "alias foo := bar\n",
stdout: "", stderr: "
stderr: "error: Alias `foo` has an unknown target `bar` error: Alias `foo` has an unknown target `bar`
| |
1 | alias foo := bar 1 | alias foo := bar
| ^^^ | ^^^
@ -262,8 +262,8 @@ integration_test! {
integration_test! { integration_test! {
name: alias_shadows_recipe, name: alias_shadows_recipe,
justfile: "bar:\n echo bar\nalias foo := bar\nfoo:\n echo foo", justfile: "bar:\n echo bar\nalias foo := bar\nfoo:\n echo foo",
stdout: "", stderr: "
stderr: "error: Alias `foo` defined on `3` shadows recipe defined on `4` error: Alias `foo` defined on `3` shadows recipe defined on `4`
| |
3 | alias foo := bar 3 | alias foo := bar
| ^^^ | ^^^
@ -275,7 +275,9 @@ integration_test! {
name: alias_show, name: alias_show,
justfile: "foo:\n bar\nalias f := foo", justfile: "foo:\n bar\nalias f := foo",
args: ("--show", "f"), args: ("--show", "f"),
stdout: "alias f := foo\nfoo: stdout: "
alias f := foo
foo:
bar bar
", ",
} }
@ -284,8 +286,8 @@ integration_test! {
name: alias_show_missing_target, name: alias_show_missing_target,
justfile: "alias f := foo", justfile: "alias f := foo",
args: ("--show", "f"), args: ("--show", "f"),
stdout: "", stderr: "
stderr: "error: Alias `f` has an unknown target `foo` error: Alias `f` has an unknown target `foo`
| |
1 | alias f := foo 1 | alias f := foo
| ^ | ^
@ -387,7 +389,8 @@ bar := hello + hello
recipe: recipe:
echo {{hello + "bar" + bar}}"#, echo {{hello + "bar" + bar}}"#,
args: ("--show", "recipe"), args: ("--show", "recipe"),
stdout: r#"recipe: stdout: r#"
recipe:
echo {{hello + "bar" + bar}} echo {{hello + "bar" + bar}}
"#, "#,
} }
@ -401,7 +404,6 @@ hello:
recipe: recipe:
@exit 100", @exit 100",
args: ("recipe"), args: ("recipe"),
stdout: "",
stderr: "error: Recipe `recipe` failed on line 6 with exit code 100\n", stderr: "error: Recipe `recipe` failed on line 6 with exit code 100\n",
status: 100, status: 100,
} }
@ -409,8 +411,8 @@ recipe:
integration_test! { integration_test! {
name: unknown_dependency, name: unknown_dependency,
justfile: "bar:\nhello:\nfoo: bar baaaaaaaz hello", justfile: "bar:\nhello:\nfoo: bar baaaaaaaz hello",
stdout: "", stderr: "
stderr: "error: Recipe `foo` has unknown dependency `baaaaaaaz` error: Recipe `foo` has unknown dependency `baaaaaaaz`
| |
3 | foo: bar baaaaaaaz hello 3 | foo: bar baaaaaaaz hello
| ^^^^^^^^^ | ^^^^^^^^^
@ -435,8 +437,8 @@ integration_test! {
integration_test! { integration_test! {
name: backtick_code_assignment, name: backtick_code_assignment,
justfile: "b := a\na := `exit 100`\nbar:\n echo '{{`exit 200`}}'", justfile: "b := a\na := `exit 100`\nbar:\n echo '{{`exit 200`}}'",
stdout: "", stderr: "
stderr: "error: Backtick failed with exit code 100 error: Backtick failed with exit code 100
| |
2 | a := `exit 100` 2 | a := `exit 100`
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -447,8 +449,8 @@ integration_test! {
integration_test! { integration_test! {
name: backtick_code_interpolation, name: backtick_code_interpolation,
justfile: "b := a\na := `echo hello`\nbar:\n echo '{{`exit 200`}}'", justfile: "b := a\na := `echo hello`\nbar:\n echo '{{`exit 200`}}'",
stdout: "", stderr: "
stderr: "error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
| |
4 | echo '{{`exit 200`}}' 4 | echo '{{`exit 200`}}'
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -459,8 +461,8 @@ integration_test! {
integration_test! { integration_test! {
name: backtick_code_interpolation_mod, name: backtick_code_interpolation_mod,
justfile: "f:\n 無{{`exit 200`}}", justfile: "f:\n 無{{`exit 200`}}",
stdout: "", stderr: "
stderr: "error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
| |
2 | {{`exit 200`}} 2 | {{`exit 200`}}
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -474,7 +476,6 @@ integration_test! {
backtick-fail: backtick-fail:
\techo {{`exit 200`}} \techo {{`exit 200`}}
", ",
stdout: "",
stderr: " error: Backtick failed with exit code 200 stderr: " error: Backtick failed with exit code 200
| |
3 | echo {{`exit 200`}} 3 | echo {{`exit 200`}}
@ -489,7 +490,6 @@ integration_test! {
backtick-fail: backtick-fail:
\techo {{\t`exit 200`}} \techo {{\t`exit 200`}}
", ",
stdout: "",
stderr: "error: Backtick failed with exit code 200 stderr: "error: Backtick failed with exit code 200
| |
3 | echo {{ `exit 200`}} 3 | echo {{ `exit 200`}}
@ -504,8 +504,8 @@ integration_test! {
backtick-fail: backtick-fail:
\techo {{\t`exit\t\t200`}} \techo {{\t`exit\t\t200`}}
", ",
stdout: "", stderr: "
stderr: "error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
| |
3 | echo {{ `exit 200`}} 3 | echo {{ `exit 200`}}
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
@ -519,8 +519,8 @@ integration_test! {
backtick-fail: backtick-fail:
\techo 😬{{`exit 200`}} \techo 😬{{`exit 200`}}
", ",
stdout: "", stderr: "
stderr: "error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
| |
3 | echo 😬{{`exit 200`}} 3 | echo 😬{{`exit 200`}}
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -534,8 +534,8 @@ integration_test! {
backtick-fail: backtick-fail:
\techo \t\t\t😬{{\t\t`exit 200 # \t\t\tabc`}}\t\t\t😬 \techo \t\t\t😬{{\t\t`exit 200 # \t\t\tabc`}}\t\t\t😬
", ",
stdout: "", stderr: "
stderr: "error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
| |
3 | echo 😬{{ `exit 200 # abc`}} 😬 3 | echo 😬{{ `exit 200 # abc`}} 😬
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -546,8 +546,8 @@ backtick-fail:
integration_test! { integration_test! {
name: backtick_code_long, name: backtick_code_long,
justfile: "\n\n\n\n\n\nb := a\na := `echo hello`\nbar:\n echo '{{`exit 200`}}'", justfile: "\n\n\n\n\n\nb := a\na := `echo hello`\nbar:\n echo '{{`exit 200`}}'",
stdout: "", stderr: "
stderr: "error: Backtick failed with exit code 200 error: Backtick failed with exit code 200
| |
10 | echo '{{`exit 200`}}' 10 | echo '{{`exit 200`}}'
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -562,7 +562,8 @@ integration_test! {
echo hello echo hello
echo {{`exit 123`}}", echo {{`exit 123`}}",
stdout: "", stdout: "",
stderr: "error: Backtick failed with exit code 123 stderr: "
error: Backtick failed with exit code 123
| |
4 | echo {{`exit 123`}} 4 | echo {{`exit 123`}}
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -576,7 +577,9 @@ integration_test! {
echo hello echo hello
echo {{`exit 123`}}", echo {{`exit 123`}}",
stdout: "hello\n", stdout: "hello\n",
stderr: "echo hello\nerror: Backtick failed with exit code 123 stderr: "
echo hello
error: Backtick failed with exit code 123
| |
3 | echo {{`exit 123`}} 3 | echo {{`exit 123`}}
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -591,7 +594,8 @@ integration_test! {
echo {{`exit 111`}} echo {{`exit 111`}}
a := `exit 222`", a := `exit 222`",
stdout: "", stdout: "",
stderr: "error: Backtick failed with exit code 222 stderr: "
error: Backtick failed with exit code 222
| |
4 | a := `exit 222` 4 | a := `exit 222`
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -606,7 +610,6 @@ integration_test! {
echo {{`exit 111`}} echo {{`exit 111`}}
a := `exit 222`", a := `exit 222`",
args: ("--set", "foo", "bar", "--set", "baz", "bob", "--set", "a", "b", "a", "b"), args: ("--set", "foo", "bar", "--set", "baz", "bob", "--set", "a", "b", "a", "b"),
stdout: "",
stderr: "error: Variables `baz` and `foo` overridden on the command line but not present \ stderr: "error: Variables `baz` and `foo` overridden on the command line but not present \
in justfile\n", in justfile\n",
status: EXIT_FAILURE, status: EXIT_FAILURE,
@ -619,7 +622,6 @@ integration_test! {
echo {{`exit 111`}} echo {{`exit 111`}}
a := `exit 222`", a := `exit 222`",
args: ("foo=bar", "baz=bob", "a=b", "a", "b"), args: ("foo=bar", "baz=bob", "a=b", "a", "b"),
stdout: "",
stderr: "error: Variables `baz` and `foo` overridden on the command line but not present \ stderr: "error: Variables `baz` and `foo` overridden on the command line but not present \
in justfile\n", in justfile\n",
status: EXIT_FAILURE, status: EXIT_FAILURE,
@ -632,7 +634,6 @@ integration_test! {
echo {{`exit 111`}} echo {{`exit 111`}}
a := `exit 222`", a := `exit 222`",
args: ("foo=bar", "a=b", "a", "b"), args: ("foo=bar", "a=b", "a", "b"),
stdout: "",
stderr: "error: Variable `foo` overridden on the command line but not present in justfile\n", stderr: "error: Variable `foo` overridden on the command line but not present in justfile\n",
status: EXIT_FAILURE, status: EXIT_FAILURE,
} }
@ -1143,7 +1144,8 @@ a Z="\t z":
_private-recipe: _private-recipe:
"#, "#,
args: ("--list"), args: ("--list"),
stdout: r#"Available recipes: stdout: r#"
Available recipes:
a Z="\t z" a Z="\t z"
hello a b='B ' c='C' # this does a thing hello a b='B ' c='C' # this does a thing
"#, "#,
@ -1164,7 +1166,8 @@ a Z="\t z":
_private-recipe: _private-recipe:
"#, "#,
args: ("--list"), args: ("--list"),
stdout: r#"Available recipes: stdout: r#"
Available recipes:
a Z="\t z" # something else a Z="\t z" # something else
hello a b='B ' c='C' # this does a thing hello a b='B ' c='C' # this does a thing
"#, "#,
@ -1189,7 +1192,8 @@ this-recipe-is-very-very-very-important Z="\t z":
_private-recipe: _private-recipe:
"#, "#,
args: ("--list"), args: ("--list"),
stdout: r#"Available recipes: stdout: r#"
Available recipes:
hello a b='B ' c='C' # this does a thing hello a b='B ' c='C' # this does a thing
this-recipe-is-very-very-very-important Z="\t z" # something else this-recipe-is-very-very-very-important Z="\t z" # something else
x a b='B ' c='C' # this does another thing x a b='B ' c='C' # this does another thing
@ -1654,10 +1658,12 @@ a:
' + "b"}}' ' + "b"}}'
"#, "#,
args: ("a"), args: ("a"),
stdout: "a stdout: "
a
b b
", ",
stderr: "echo 'a stderr: "
echo 'a
b' b'
", ",
} }
@ -1797,10 +1803,13 @@ a B C +D='hello':
echo {{B}} {{C}} {{D}} echo {{B}} {{C}} {{D}}
", ",
args: ("--color", "always", "--list"), args: ("--color", "always", "--list"),
stdout: "Available recipes:\n a \ stdout: "
Available recipes:
a \
\u{1b}[36mB\u{1b}[0m \u{1b}[36mC\u{1b}[0m \u{1b}[35m+\ \u{1b}[36mB\u{1b}[0m \u{1b}[36mC\u{1b}[0m \u{1b}[35m+\
\u{1b}[0m\u{1b}[36mD\u{1b}[0m=\u{1b}[32m'hello'\u{1b}[0m \ \u{1b}[0m\u{1b}[36mD\u{1b}[0m=\u{1b}[32m'hello'\u{1b}[0m \
\u{1b}[34m#\u{1b}[0m \u{1b}[34mcomment\u{1b}[0m\n", \u{1b}[34m#\u{1b}[0m \u{1b}[34mcomment\u{1b}[0m
",
} }
integration_test! { integration_test! {
@ -1986,8 +1995,8 @@ integration_test! {
foo: foo:
echo {{ echo {{
", ",
stdout: "", stderr: r#"
stderr: r#"error: Unterminated interpolation error: Unterminated interpolation
| |
3 | echo {{ 3 | echo {{
| ^^ | ^^
@ -2000,8 +2009,8 @@ integration_test! {
justfile: " justfile: "
foo: foo:
echo {{", echo {{",
stdout: "", stderr: r#"
stderr: r#"error: Unterminated interpolation error: Unterminated interpolation
| |
3 | echo {{ 3 | echo {{
| ^^ | ^^
@ -2014,8 +2023,8 @@ integration_test! {
justfile: " justfile: "
foo a=\t`echo blaaaaaah: foo a=\t`echo blaaaaaah:
echo {{a}}", echo {{a}}",
stdout: "", stderr: r#"
stderr: r#"error: Unterminated backtick error: Unterminated backtick
| |
2 | foo a= `echo blaaaaaah: 2 | foo a= `echo blaaaaaah:
| ^ | ^
@ -2028,8 +2037,8 @@ integration_test! {
justfile: " justfile: "
assembly_source_files = $(wildcard src/arch/$(arch)/*.s) assembly_source_files = $(wildcard src/arch/$(arch)/*.s)
", ",
stdout: "", stderr: r#"
stderr: r#"error: Unknown start of token: error: Unknown start of token:
| |
2 | assembly_source_files = $(wildcard src/arch/$(arch)/*.s) 2 | assembly_source_files = $(wildcard src/arch/$(arch)/*.s)
| ^ | ^
@ -2068,12 +2077,15 @@ default stdin = `cat justfile`:
echo '{{stdin}}' echo '{{stdin}}'
", ",
stdout: " stdout: "
default stdin = `cat justfile`: default stdin = `cat justfile`:
echo {{stdin}} echo {{stdin}}
", ",
stderr: "echo ' stderr: "
echo '
default stdin = `cat justfile`: default stdin = `cat justfile`:
echo '{{stdin}}''\n", echo '{{stdin}}''
",
} }
integration_test! { integration_test! {