just/tests/scope.rs
Casey Rodarmor 7c43a5829d
Some checks failed
CI / test (macos-latest) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / msrv (push) Has been cancelled
CI / pages (push) Has been cancelled
CI / test (ubuntu-latest) (push) Has been cancelled
CI / test (windows-latest) (push) Has been cancelled
Use correct scope when running recipes in submodules (#2810)
2025-07-12 00:50:16 -07:00

34 lines
609 B
Rust

use super::*;
#[test]
fn dependencies_in_submodules_run_with_submodule_scope() {
Test::new()
.write("bar.just", "x := 'X'\nbar a=x:\n echo {{ a }} {{ x }}")
.justfile(
"
mod bar
foo: bar::bar
",
)
.stdout("X X\n")
.stderr("echo X X\n")
.run();
}
#[test]
fn aliases_in_submodules_run_with_submodule_scope() {
Test::new()
.write("bar.just", "x := 'X'\nbar a=x:\n echo {{ a }} {{ x }}")
.justfile(
"
mod bar
alias foo := bar::bar
",
)
.arg("foo")
.stdout("X X\n")
.stderr("echo X X\n")
.run();
}