Skip to content

Commit baa7fce

Browse files
committed
add coverage for multiple paths
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 3807440 commit baa7fce

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/bootstrap/src/core/builder/tests.rs

+20
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,26 @@ fn test_intersection() {
121121
]);
122122
}
123123

124+
#[test]
125+
fn test_resolve_parent_and_subpaths() {
126+
let set = |paths: &[&str]| {
127+
PathSet::Set(paths.into_iter().map(|p| TaskPath { path: p.into(), kind: None }).collect())
128+
};
129+
130+
let mut command_paths = vec![
131+
CLIStepPath::from(PathBuf::from("src/tools/miri")),
132+
CLIStepPath::from(PathBuf::from("src/tools/miri/cargo-miri")),
133+
];
134+
135+
let library_set = set(&["src/tools/miri", "src/tools/miri/cargo-miri"]);
136+
library_set.intersection_removing_matches(&mut command_paths, Kind::Build);
137+
138+
assert_eq!(command_paths, vec![
139+
CLIStepPath::from(PathBuf::from("src/tools/miri")).will_be_executed(true),
140+
CLIStepPath::from(PathBuf::from("src/tools/miri/cargo-miri")).will_be_executed(true),
141+
]);
142+
}
143+
124144
#[test]
125145
fn validate_path_remap() {
126146
let build = Build::new(configure("test", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]));

0 commit comments

Comments
 (0)