summaryrefslogtreecommitdiffstats
path: root/tests/tree.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tree.rs')
-rw-r--r--tests/tree.rs103
1 files changed, 103 insertions, 0 deletions
diff --git a/tests/tree.rs b/tests/tree.rs
new file mode 100644
index 00000000..0644d58a
--- /dev/null
+++ b/tests/tree.rs
@@ -0,0 +1,103 @@
+use super::*;
+
+#[test]
+fn single_recipe() {
+ Test::new()
+ .justfile("foo:")
+ .arg("--tree")
+ .stdout(
+ "
+ └── foo
+ ",
+ )
+ .run();
+}
+
+#[test]
+fn multiple_recipes() {
+ Test::new()
+ .justfile(
+ "
+ foo:
+ bar:
+ baz:
+ ",
+ )
+ .arg("--tree")
+ .stdout(
+ "
+ ├── bar
+ ├── baz
+ └── foo
+ ",
+ )
+ .run();
+}
+
+#[test]
+fn dependencies() {
+ Test::new()
+ .justfile(
+ "
+ foo: bar baz
+ bar: baz
+ baz:
+ ",
+ )
+ .arg("--tree")
+ .stdout(
+ "
+ ├── bar
+ │ └── baz
+ ├── baz
+ └── foo
+ ├── bar
+ └── baz
+ ",
+ )
+ .run();
+}
+
+#[test]
+fn submodule() {
+ Test::new()
+ .justfile(
+ "
+ mod foo
+ ",
+ )
+ .write("foo.just", "bar:")
+ .test_round_trip(false)
+ .args(["--tree", "--unstable"])
+ .stdout(
+ "
+ └── foo
+ └── bar
+ ",
+ )
+ .run();
+}
+
+#[test]
+fn multiple_submodules() {
+ Test::new()
+ .justfile(
+ "
+ mod foo
+ mod baz
+ ",
+ )
+ .write("foo.just", "bar:")
+ .write("baz.just", "qux:")
+ .test_round_trip(false)
+ .args(["--tree", "--unstable"])
+ .stdout(
+ "
+ ├── baz
+ │ └── qux
+ └── foo
+ └── bar
+ ",
+ )
+ .run();
+}