1
1
mirror of https://github.com/casey/just.git synced 2024-11-26 11:43:43 +03:00
just/tests/summary.rs
2023-12-29 03:06:48 +00:00

74 lines
1.1 KiB
Rust

use super::*;
test! {
name: summary,
justfile: "b: a
a:
d: c
c: b
_z: _y
_y:
",
args: ("--summary"),
stdout: "a b c d\n",
}
test! {
name: summary_sorted,
justfile: "
b:
c:
a:
",
args: ("--summary"),
stdout: "a b c\n",
}
test! {
name: summary_unsorted,
justfile: "
b:
c:
a:
",
args: ("--summary", "--unsorted"),
stdout: "b c a\n",
}
test! {
name: summary_none,
justfile: "",
args: ("--summary", "--quiet"),
stdout: "\n\n\n",
}
#[test]
fn no_recipes() {
Test::new()
.arg("--summary")
.stderr("Justfile contains no recipes.\n")
.stdout("\n\n\n")
.run();
}
#[test]
fn submodule_recipes() {
Test::new()
.write("foo.just", "mod bar\nfoo:")
.write("bar.just", "mod baz\nbar:")
.write("baz.just", "mod biz\nbaz:")
.write("biz.just", "biz:")
.justfile(
"
mod foo
bar:
",
)
.test_round_trip(false)
.arg("--unstable")
.arg("--summary")
.stdout("bar foo::foo foo::bar::bar foo::bar::baz::baz foo::bar::baz::biz::biz\n")
.run();
}