2022-06-19 07:56:31 +03:00
|
|
|
use super::*;
|
2021-11-17 11:07:48 +03:00
|
|
|
|
2023-12-28 07:27:15 +03:00
|
|
|
fn case(justfile: &str, value: Value) {
|
2021-11-17 11:07:48 +03:00
|
|
|
Test::new()
|
|
|
|
.justfile(justfile)
|
2023-01-04 09:31:56 +03:00
|
|
|
.args(["--dump", "--dump-format", "json", "--unstable"])
|
2021-11-17 11:07:48 +03:00
|
|
|
.stdout(format!("{}\n", serde_json::to_string(&value).unwrap()))
|
|
|
|
.run();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn alias() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"
|
|
|
|
alias f := foo
|
|
|
|
|
|
|
|
foo:
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"first": "foo",
|
|
|
|
"aliases": {
|
|
|
|
"f": {
|
|
|
|
"name": "f",
|
|
|
|
"target": "foo",
|
2022-12-20 11:44:19 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"assignments": {},
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"foo": {
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn assignment() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"foo := 'bar'",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {
|
|
|
|
"foo": {
|
|
|
|
"export": false,
|
|
|
|
"name": "foo",
|
|
|
|
"value": "bar",
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"first": null,
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn body() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"
|
|
|
|
foo:
|
|
|
|
bar
|
|
|
|
abc{{ 'xyz' }}def
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "foo",
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"foo": {
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
"body": [
|
|
|
|
["bar"],
|
|
|
|
["abc", ["xyz"], "def"],
|
|
|
|
],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn dependencies() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"
|
|
|
|
foo:
|
|
|
|
bar: foo
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "foo",
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"bar": {
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
"doc": null,
|
|
|
|
"name": "bar",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "bar",
|
2021-11-17 11:07:48 +03:00
|
|
|
"body": [],
|
|
|
|
"dependencies": [{
|
|
|
|
"arguments": [],
|
|
|
|
"recipe": "foo"
|
|
|
|
}],
|
|
|
|
"parameters": [],
|
|
|
|
"priors": 1,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
|
|
|
},
|
|
|
|
"foo": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn dependency_argument() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"
|
|
|
|
x := 'foo'
|
|
|
|
foo *args:
|
|
|
|
bar: (
|
|
|
|
foo
|
|
|
|
'baz'
|
|
|
|
('baz')
|
|
|
|
('a' + 'b')
|
|
|
|
`echo`
|
|
|
|
x
|
|
|
|
if 'a' == 'b' { 'c' } else { 'd' }
|
|
|
|
arch()
|
|
|
|
env_var('foo')
|
|
|
|
join('a', 'b')
|
|
|
|
replace('a', 'b', 'c')
|
|
|
|
)
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"first": "foo",
|
|
|
|
"assignments": {
|
|
|
|
"x": {
|
|
|
|
"export": false,
|
|
|
|
"name": "x",
|
|
|
|
"value": "foo",
|
|
|
|
},
|
|
|
|
},
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"bar": {
|
|
|
|
"doc": null,
|
|
|
|
"name": "bar",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "bar",
|
2021-11-17 11:07:48 +03:00
|
|
|
"body": [],
|
|
|
|
"dependencies": [{
|
|
|
|
"arguments": [
|
|
|
|
"baz",
|
|
|
|
"baz",
|
2022-12-30 23:36:08 +03:00
|
|
|
["concatenate", "a", "b"],
|
2021-11-17 11:07:48 +03:00
|
|
|
["evaluate", "echo"],
|
|
|
|
["variable", "x"],
|
|
|
|
["if", "==", "a", "b", "c", "d"],
|
|
|
|
["call", "arch"],
|
|
|
|
["call", "env_var", "foo"],
|
|
|
|
["call", "join", "a", "b"],
|
|
|
|
["call", "replace", "a", "b", "c"],
|
|
|
|
],
|
|
|
|
"recipe": "foo"
|
|
|
|
}],
|
|
|
|
"parameters": [],
|
|
|
|
"priors": 1,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"foo": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "args",
|
|
|
|
"export": false,
|
|
|
|
"default": null,
|
|
|
|
"kind": "star",
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2022-02-15 05:37:06 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2022-02-15 05:37:06 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2022-02-15 05:37:06 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-02-15 05:37:06 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2022-02-15 05:37:06 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn duplicate_recipes() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2022-02-15 05:37:06 +03:00
|
|
|
"
|
|
|
|
set allow-duplicate-recipes
|
|
|
|
alias f := foo
|
|
|
|
|
|
|
|
foo:
|
|
|
|
foo bar:
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"first": "foo",
|
|
|
|
"aliases": {
|
|
|
|
"f": {
|
2022-12-20 11:44:19 +03:00
|
|
|
"attributes": [],
|
2022-02-15 05:37:06 +03:00
|
|
|
"name": "f",
|
|
|
|
"target": "foo",
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"assignments": {},
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2022-02-15 05:37:06 +03:00
|
|
|
"recipes": {
|
|
|
|
"foo": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2022-02-15 05:37:06 +03:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "bar",
|
|
|
|
"export": false,
|
|
|
|
"default": null,
|
|
|
|
"kind": "singular",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2022-02-15 05:37:06 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"allow_duplicate_recipes": true,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn doc_comment() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"# hello\nfoo:",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"first": "foo",
|
|
|
|
"assignments": {},
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"foo": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": "hello",
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn empty_justfile() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": null,
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn parameters() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"
|
|
|
|
a:
|
|
|
|
b x:
|
|
|
|
c x='y':
|
|
|
|
d +x:
|
|
|
|
e *x:
|
|
|
|
f $x:
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"first": "a",
|
|
|
|
"assignments": {},
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"a": {
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "a",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "a",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
|
|
|
},
|
|
|
|
"b": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "b",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "b",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "x",
|
|
|
|
"export": false,
|
|
|
|
"default": null,
|
|
|
|
"kind": "singular",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"c": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "c",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "c",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "x",
|
|
|
|
"export": false,
|
|
|
|
"default": "y",
|
|
|
|
"kind": "singular",
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"d": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "d",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "d",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "x",
|
|
|
|
"export": false,
|
|
|
|
"default": null,
|
|
|
|
"kind": "plus",
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"e": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "e",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "e",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "x",
|
|
|
|
"export": false,
|
|
|
|
"default": null,
|
|
|
|
"kind": "star",
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"f": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "f",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "f",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "x",
|
|
|
|
"export": true,
|
|
|
|
"default": null,
|
|
|
|
"kind": "singular",
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn priors() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"
|
|
|
|
a:
|
|
|
|
b: a && c
|
|
|
|
c:
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "a",
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"a": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "a",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "a",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"b": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [
|
|
|
|
{
|
|
|
|
"arguments": [],
|
|
|
|
"recipe": "a",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [],
|
|
|
|
"recipe": "c",
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"doc": null,
|
|
|
|
"name": "b",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "b",
|
2021-11-17 11:07:48 +03:00
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 1,
|
|
|
|
},
|
|
|
|
"c": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "c",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "c",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn private() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"_foo:",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "_foo",
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"_foo": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "_foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "_foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": true,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn quiet() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"@foo:",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "foo",
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"foo": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": true,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn settings() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"
|
|
|
|
set dotenv-load
|
2023-10-12 08:04:46 +03:00
|
|
|
set dotenv-filename := \"filename\"
|
|
|
|
set dotenv-path := \"path\"
|
2021-11-17 11:07:48 +03:00
|
|
|
set export
|
2022-10-20 05:00:09 +03:00
|
|
|
set fallback
|
2021-11-17 11:07:48 +03:00
|
|
|
set positional-arguments
|
2022-10-05 03:32:30 +03:00
|
|
|
set ignore-comments
|
2021-11-17 11:07:48 +03:00
|
|
|
set shell := ['a', 'b', 'c']
|
|
|
|
foo:
|
|
|
|
#!bar
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "foo",
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"foo": {
|
|
|
|
"body": [["#!bar"]],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": true,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": "filename",
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": true,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": "path",
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": true,
|
2022-10-20 05:00:09 +03:00
|
|
|
"fallback": true,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": true,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": true,
|
|
|
|
"shell": {
|
|
|
|
"arguments": ["b", "c"],
|
|
|
|
"command": "a",
|
|
|
|
},
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir": null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn shebang() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"
|
|
|
|
foo:
|
|
|
|
#!bar
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "foo",
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"foo": {
|
|
|
|
"body": [["#!bar"]],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": true,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2021-11-17 11:07:48 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir": null,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn simple() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2021-11-17 11:07:48 +03:00
|
|
|
"foo:",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "foo",
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2021-11-17 11:07:48 +03:00
|
|
|
"recipes": {
|
|
|
|
"foo": {
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2021-11-17 11:07:48 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": [],
|
2022-10-26 02:32:36 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2022-10-26 02:32:36 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2022-10-26 02:32:36 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2022-10-26 02:32:36 +03:00
|
|
|
"ignore_comments": false,
|
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir": null,
|
2022-10-26 02:32:36 +03:00
|
|
|
"windows_powershell": false,
|
|
|
|
"windows_shell": null,
|
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn attribute() {
|
2023-12-28 07:27:15 +03:00
|
|
|
case(
|
2022-10-26 02:32:36 +03:00
|
|
|
"
|
|
|
|
[no-exit-message]
|
|
|
|
foo:
|
|
|
|
",
|
|
|
|
json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "foo",
|
2023-12-28 07:27:15 +03:00
|
|
|
"modules": {},
|
2022-10-26 02:32:36 +03:00
|
|
|
"recipes": {
|
|
|
|
"foo": {
|
2022-10-31 10:52:03 +03:00
|
|
|
"attributes": ["no-exit-message"],
|
2022-10-26 02:32:36 +03:00
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "foo",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo",
|
2022-10-26 02:32:36 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
2022-02-15 05:37:06 +03:00
|
|
|
"allow_duplicate_recipes": false,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_filename": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"dotenv_load": null,
|
2023-10-12 08:04:46 +03:00
|
|
|
"dotenv_path": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
"export": false,
|
2022-11-26 00:02:01 +03:00
|
|
|
"fallback": false,
|
2021-11-17 11:07:48 +03:00
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
2022-10-26 02:57:20 +03:00
|
|
|
"tempdir" : null,
|
2022-10-05 03:32:30 +03:00
|
|
|
"ignore_comments": false,
|
2022-01-18 22:02:15 +03:00
|
|
|
"windows_powershell": false,
|
2022-05-31 23:01:59 +03:00
|
|
|
"windows_shell": null,
|
2021-11-17 11:07:48 +03:00
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
2023-12-28 07:27:15 +03:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn module() {
|
|
|
|
Test::new()
|
|
|
|
.justfile(
|
|
|
|
"
|
|
|
|
mod foo
|
|
|
|
",
|
|
|
|
)
|
|
|
|
.tree(tree! {
|
|
|
|
"foo.just": "bar:",
|
|
|
|
})
|
|
|
|
.args(["--dump", "--dump-format", "json", "--unstable"])
|
|
|
|
.test_round_trip(false)
|
|
|
|
.stdout(format!(
|
|
|
|
"{}\n",
|
|
|
|
serde_json::to_string(&json!({
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": null,
|
|
|
|
"modules": {
|
|
|
|
"foo": {
|
|
|
|
"aliases": {},
|
|
|
|
"assignments": {},
|
|
|
|
"first": "bar",
|
|
|
|
"modules": {},
|
|
|
|
"recipes": {
|
|
|
|
"bar": {
|
|
|
|
"attributes": [],
|
|
|
|
"body": [],
|
|
|
|
"dependencies": [],
|
|
|
|
"doc": null,
|
|
|
|
"name": "bar",
|
2024-01-09 00:26:33 +03:00
|
|
|
"namepath": "foo::bar",
|
2023-12-28 07:27:15 +03:00
|
|
|
"parameters": [],
|
|
|
|
"priors": 0,
|
|
|
|
"private": false,
|
|
|
|
"quiet": false,
|
|
|
|
"shebang": false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"allow_duplicate_recipes": false,
|
|
|
|
"dotenv_filename": null,
|
|
|
|
"dotenv_load": null,
|
|
|
|
"dotenv_path": null,
|
|
|
|
"export": false,
|
|
|
|
"fallback": false,
|
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
|
|
|
"tempdir" : null,
|
|
|
|
"ignore_comments": false,
|
|
|
|
"windows_powershell": false,
|
|
|
|
"windows_shell": null,
|
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"recipes": {},
|
|
|
|
"settings": {
|
|
|
|
"allow_duplicate_recipes": false,
|
|
|
|
"dotenv_filename": null,
|
|
|
|
"dotenv_load": null,
|
|
|
|
"dotenv_path": null,
|
|
|
|
"export": false,
|
|
|
|
"fallback": false,
|
|
|
|
"positional_arguments": false,
|
|
|
|
"shell": null,
|
|
|
|
"tempdir" : null,
|
|
|
|
"ignore_comments": false,
|
|
|
|
"windows_powershell": false,
|
|
|
|
"windows_shell": null,
|
|
|
|
},
|
|
|
|
"warnings": [],
|
|
|
|
}))
|
|
|
|
.unwrap()
|
|
|
|
))
|
|
|
|
.run();
|
|
|
|
}
|