Skip to content

Commit bac6b46

Browse files
committed
more tests
1 parent 4488968 commit bac6b46

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/recipe_dependencies.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,43 @@ fn recipe_dependency_nested_module() {
1616
.stdout("BAZ\n")
1717
.run();
1818
}
19+
20+
#[test]
21+
fn recipe_dependency_nested_module2() {
22+
Test::new()
23+
.write("foo.just", "mod bar\nbaz: \n @echo BAR")
24+
.write("bar.just", "baz:\n @echo BAZ")
25+
.justfile(
26+
"
27+
mod foo
28+
baz: foo::baz
29+
",
30+
)
31+
.arg("baz")
32+
.stdout("BAR\n")
33+
.run();
34+
}
35+
36+
#[test]
37+
fn recipe_dependency_on_module_fails() {
38+
Test::new()
39+
.write("foo.just", "mod bar\nbaz: \n @echo BAR")
40+
.write("bar.just", "baz:\n @echo BAZ")
41+
.justfile(
42+
"
43+
mod foo
44+
baz: foo::bar
45+
",
46+
)
47+
.arg("baz")
48+
.status(1)
49+
.stderr(
50+
"error: Recipe `baz` has unknown dependency `foo::bar`
51+
——▶ justfile:2:11
52+
53+
2 │ baz: foo::bar
54+
│ ^^^
55+
",
56+
)
57+
.run();
58+
}

0 commit comments

Comments
 (0)