mirror of
https://github.com/casey/just.git
synced 2025-07-07 17:45:00 +00:00
Add just.systems
link to --init
justfile (#2776)
This commit is contained in:
parent
79623feaa2
commit
b48474713b
3 changed files with 15 additions and 12 deletions
|
@ -151,7 +151,7 @@ use request::Request;
|
|||
|
||||
// Used in integration tests.
|
||||
#[doc(hidden)]
|
||||
pub use {request::Response, unindent::unindent};
|
||||
pub use {request::Response, subcommand::INIT_JUSTFILE, unindent::unindent};
|
||||
|
||||
type CompileResult<'a, T = ()> = Result<T, CompileError<'a>>;
|
||||
type ConfigResult<T> = Result<T, ConfigError>;
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
use {super::*, clap_mangen::Man};
|
||||
|
||||
const INIT_JUSTFILE: &str = "default:\n echo 'Hello, world!'\n";
|
||||
pub const INIT_JUSTFILE: &str = "\
|
||||
# https://just.systems
|
||||
|
||||
foo:
|
||||
echo 'Hello, world!'
|
||||
";
|
||||
|
||||
fn backtick_re() -> &'static Regex {
|
||||
static BACKTICK_RE: OnceLock<Regex> = OnceLock::new();
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
use super::*;
|
||||
|
||||
const EXPECTED: &str = "default:\n echo 'Hello, world!'\n";
|
||||
use {super::*, just::INIT_JUSTFILE};
|
||||
|
||||
#[test]
|
||||
fn current_dir() {
|
||||
|
@ -16,7 +14,7 @@ fn current_dir() {
|
|||
|
||||
assert_eq!(
|
||||
fs::read_to_string(tmp.path().join("justfile")).unwrap(),
|
||||
EXPECTED
|
||||
INIT_JUSTFILE
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -72,7 +70,7 @@ fn invocation_directory() {
|
|||
.arg("--init")
|
||||
.run();
|
||||
|
||||
assert_eq!(fs::read_to_string(justfile_path).unwrap(), EXPECTED);
|
||||
assert_eq!(fs::read_to_string(justfile_path).unwrap(), INIT_JUSTFILE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -92,7 +90,7 @@ fn parent_dir() {
|
|||
|
||||
assert_eq!(
|
||||
fs::read_to_string(tmp.path().join("justfile")).unwrap(),
|
||||
EXPECTED
|
||||
INIT_JUSTFILE
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -112,7 +110,7 @@ fn alternate_marker() {
|
|||
|
||||
assert_eq!(
|
||||
fs::read_to_string(tmp.path().join("justfile")).unwrap(),
|
||||
EXPECTED
|
||||
INIT_JUSTFILE
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -135,7 +133,7 @@ fn search_directory() {
|
|||
|
||||
assert_eq!(
|
||||
fs::read_to_string(tmp.path().join("sub/justfile")).unwrap(),
|
||||
EXPECTED
|
||||
INIT_JUSTFILE
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -159,7 +157,7 @@ fn justfile() {
|
|||
|
||||
assert_eq!(
|
||||
fs::read_to_string(tmp.path().join("justfile")).unwrap(),
|
||||
EXPECTED
|
||||
INIT_JUSTFILE
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -185,7 +183,7 @@ fn justfile_and_working_directory() {
|
|||
|
||||
assert_eq!(
|
||||
fs::read_to_string(tmp.path().join("justfile")).unwrap(),
|
||||
EXPECTED
|
||||
INIT_JUSTFILE
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue