Skip to content

Commit 786e195

Browse files
committed
add check_diff to self_tests
1 parent 3b3cbdf commit 786e195

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/test/mod.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,19 +383,21 @@ fn idempotence_tests() {
383383
fn self_tests() {
384384
init_log();
385385
let mut files = get_test_files(Path::new("tests"), false);
386-
let bin_directories = vec![
387-
"cargo-fmt",
388-
"git-rustfmt",
389-
"bin",
390-
"format-diff",
391-
"check_diff",
392-
];
386+
let bin_directories = vec!["cargo-fmt", "git-rustfmt", "bin", "format-diff"];
393387
for dir in bin_directories {
394388
let mut path = PathBuf::from("src");
395389
path.push(dir);
396390
path.push("main.rs");
397391
files.push(path);
398392
}
393+
// for crates that need to be included but lies outside src
394+
let external_crates = vec!["check_diff"];
395+
for external_crate in external_crates {
396+
let mut path = PathBuf::from(external_crate);
397+
path.push("src");
398+
path.push("main.rs");
399+
files.push(path);
400+
}
399401
files.push(PathBuf::from("src/lib.rs"));
400402

401403
let (reports, count, fails) = check_files(files, &Some(PathBuf::from("rustfmt.toml")));

0 commit comments

Comments
 (0)