Skip to content

Commit 13b9b5f

Browse files
committed
make CargoFmtStrategy an argument to cargo-fmt test helper function
1 parent ee329d3 commit 13b9b5f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/cargo-fmt/test/targets.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ mod all_targets {
1414
source_root: &str,
1515
exp_targets: &[ExpTarget],
1616
exp_num_targets: usize,
17+
strategy: CargoFmtStrategy,
1718
) {
1819
let root_path = Path::new("tests/cargo-fmt/source").join(source_root);
1920
let get_path = |exp: &str| PathBuf::from(&root_path).join(exp).canonicalize().unwrap();
2021
let manifest_path = Path::new(&root_path).join(manifest_suffix);
21-
let targets = get_targets(&CargoFmtStrategy::All, Some(manifest_path.as_path()))
22+
let targets = get_targets(&strategy, Some(manifest_path.as_path()))
2223
.expect("Targets should have been loaded");
2324

2425
assert_eq!(targets.len(), exp_num_targets);
@@ -58,6 +59,7 @@ mod all_targets {
5859
"divergent-crate-dir-names",
5960
&exp_targets,
6061
3,
62+
CargoFmtStrategy::All,
6163
);
6264
}
6365

@@ -113,6 +115,7 @@ mod all_targets {
113115
"workspaces/path-dep-above",
114116
&exp_targets,
115117
6,
118+
CargoFmtStrategy::All,
116119
);
117120
}
118121

0 commit comments

Comments
 (0)