Skip to content

Commit 671c476

Browse files
committed
Adjust GitBinSuffixes so uses in the test method are clearer
1 parent 5258f7a commit 671c476

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

gix-path/src/env/git.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ mod tests {
315315

316316
#[cfg(windows)]
317317
impl<'a> GitBinSuffixes<'a> {
318-
/// Assert that `ALTERNATIVE_LOCATIONS` has the given prefixes, and extract the suffixes.
319-
fn assert_from(pf: &'a ProgramFilesPaths) -> Self {
320-
match super::ALTERNATIVE_LOCATIONS.as_slice() {
318+
/// Assert that `locations` has the given prefixes, and extract the suffixes.
319+
fn assert_from(pf: &'a ProgramFilesPaths, locations: &'static [PathBuf]) -> Self {
320+
match locations {
321321
[primary, secondary] => {
322322
let prefix_64bit = pf
323323
.maybe_64bit
@@ -346,7 +346,7 @@ mod tests {
346346
}
347347

348348
/// Assert that the suffixes are the common per-architecture Git install locations.
349-
fn validate(&self) {
349+
fn assert_architectures(&self) {
350350
assert_eq!(self.x86, Path::new("Git/mingw32/bin"));
351351

352352
if let Some(suffix_64bit) = self.maybe_64bit {
@@ -362,11 +362,13 @@ mod tests {
362362
#[test]
363363
#[cfg(windows)]
364364
fn alternative_locations() {
365+
let locations = super::ALTERNATIVE_LOCATIONS.as_slice();
366+
365367
// Obtain program files directory paths by other means and check that they seem correct.
366368
let pf = ProgramFilesPaths::obtain_envlessly().validate();
367369

368370
// Check that `ALTERNATIVE_LOCATIONS` correspond to them, with the correct subdirectories.
369-
GitBinSuffixes::assert_from(&pf).validate();
371+
GitBinSuffixes::assert_from(&pf, locations).assert_architectures();
370372

371373
// FIXME: Assert the other relationships between pf values and ALTERNATIVE_LOCATIONS contents!
372374
}

0 commit comments

Comments
 (0)