@@ -315,9 +315,9 @@ mod tests {
315
315
316
316
#[ cfg( windows) ]
317
317
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 {
321
321
[ primary, secondary] => {
322
322
let prefix_64bit = pf
323
323
. maybe_64bit
@@ -346,7 +346,7 @@ mod tests {
346
346
}
347
347
348
348
/// Assert that the suffixes are the common per-architecture Git install locations.
349
- fn validate ( & self ) {
349
+ fn assert_architectures ( & self ) {
350
350
assert_eq ! ( self . x86, Path :: new( "Git/mingw32/bin" ) ) ;
351
351
352
352
if let Some ( suffix_64bit) = self . maybe_64bit {
@@ -362,11 +362,13 @@ mod tests {
362
362
#[ test]
363
363
#[ cfg( windows) ]
364
364
fn alternative_locations ( ) {
365
+ let locations = super :: ALTERNATIVE_LOCATIONS . as_slice ( ) ;
366
+
365
367
// Obtain program files directory paths by other means and check that they seem correct.
366
368
let pf = ProgramFilesPaths :: obtain_envlessly ( ) . validate ( ) ;
367
369
368
370
// 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 ( ) ;
370
372
371
373
// FIXME: Assert the other relationships between pf values and ALTERNATIVE_LOCATIONS contents!
372
374
}
0 commit comments