Format --init justfile (#1116)

This commit is contained in:
Tim Byrne 2022-02-23 13:47:43 -06:00 committed by GitHub
parent fecb5e3f9d
commit 63f96037c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -1,6 +1,6 @@
use crate::common::*;
const INIT_JUSTFILE: &str = "default:\n\techo 'Hello, world!'\n";
const INIT_JUSTFILE: &str = "default:\n echo 'Hello, world!'\n";
#[derive(PartialEq, Clone, Debug)]
pub(crate) enum Subcommand {

View File

@ -1,6 +1,6 @@
use crate::common::*;
const EXPECTED: &str = "default:\n\techo 'Hello, world!'\n";
const EXPECTED: &str = "default:\n echo 'Hello, world!'\n";
#[test]
fn current_dir() {
@ -188,3 +188,19 @@ fn justfile_and_working_directory() {
EXPECTED
);
}
#[test]
fn fmt_compatibility() {
let tempdir = Test::new()
.no_justfile()
.arg("--init")
.stderr_regex("Wrote justfile to `.*`\n")
.run();
Test::with_tempdir(tempdir)
.no_justfile()
.arg("--unstable")
.arg("--check")
.arg("--fmt")
.status(EXIT_SUCCESS)
.run();
}