Skip to content

Commit ff3df53

Browse files
committed
Update alternative locations unit tests for ARM64
Similar to the preceding commit but for unit-style tests rather than integration-style tests, this updates the unit tests for Windows-specific `git` executable alternative locations to include `clangarm64/bin` directories when looking under the 64-bit program files directory. (The tests that are updated here are those that are true unit tests, because they examine the `locations_under_program_files()` helper function that takes a dependency-injected `var_os()`-like function, rather than examining `ALTERNATIVE_LOCATIONS` itself.) As in the integration-style tests updated in the preceding commit, these tests will now fail until the logic for enumerating alternative locations to check for the `git` executable is fixed to include a location for ARM64, under `clangarm64` (as well as still checking for a x86_64 build, under `mingw64`).
1 parent e9770a7 commit ff3df53

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

gix-path/src/env/git/tests.rs

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ mod locations {
5656
"ProgramFiles" => r"C:\Program Files",
5757
),
5858
if cfg!(target_pointer_width = "64") {
59-
pathbuf_vec![r"C:\Program Files\Git\mingw64\bin"]
59+
pathbuf_vec![
60+
r"C:\Program Files\Git\clangarm64\bin",
61+
r"C:\Program Files\Git\mingw64\bin",
62+
]
6063
} else {
6164
pathbuf_vec![r"C:\Program Files\Git\mingw32\bin"]
6265
},
@@ -74,6 +77,7 @@ mod locations {
7477
"ProgramW6432" => r"C:\Program Files",
7578
),
7679
pathbuf_vec![
80+
r"C:\Program Files\Git\clangarm64\bin",
7781
r"C:\Program Files\Git\mingw64\bin",
7882
r"C:\Program Files (x86)\Git\mingw32\bin",
7983
],
@@ -89,21 +93,31 @@ mod locations {
8993
"ProgramFiles(x86)" => r"Y:\nar\row",
9094
"ProgramW6432" => r"Z:\wi\de",
9195
),
92-
pathbuf_vec![
93-
r"Z:\wi\de\Git\mingw64\bin",
94-
r"Y:\nar\row\Git\mingw32\bin",
95-
if cfg!(target_pointer_width = "64") {
96-
r"X:\cur\rent\Git\mingw64\bin"
97-
} else {
98-
r"X:\cur\rent\Git\mingw32\bin"
99-
},
100-
],
96+
if cfg!(target_pointer_width = "64") {
97+
pathbuf_vec![
98+
r"Z:\wi\de\Git\clangarm64\bin",
99+
r"Z:\wi\de\Git\mingw64\bin",
100+
r"Y:\nar\row\Git\mingw32\bin",
101+
r"X:\cur\rent\Git\clangarm64\bin",
102+
r"X:\cur\rent\Git\mingw64\bin",
103+
]
104+
} else {
105+
pathbuf_vec![
106+
r"Z:\wi\de\Git\clangarm64\bin",
107+
r"Z:\wi\de\Git\mingw64\bin",
108+
r"Y:\nar\row\Git\mingw32\bin",
109+
r"X:\cur\rent\Git\mingw32\bin",
110+
]
111+
},
101112
);
102113
assert_eq!(
103114
locations_from!(
104115
"ProgramW6432" => r"Z:\wi\de",
105116
),
106-
pathbuf_vec![r"Z:\wi\de\Git\mingw64\bin"],
117+
pathbuf_vec![
118+
r"Z:\wi\de\Git\clangarm64\bin",
119+
r"Z:\wi\de\Git\mingw64\bin",
120+
],
107121
);
108122
assert_eq!(
109123
locations_from!(
@@ -112,9 +126,14 @@ mod locations {
112126
"ProgramW6432" => r"Z:\wi\.\de",
113127
),
114128
if cfg!(target_pointer_width = "64") {
115-
pathbuf_vec![r"Z:\wi\de\Git\mingw64\bin", r"Y:\nar\row\Git\mingw32\bin"]
129+
pathbuf_vec![
130+
r"Z:\wi\de\Git\clangarm64\bin",
131+
r"Z:\wi\de\Git\mingw64\bin",
132+
r"Y:\nar\row\Git\mingw32\bin",
133+
]
116134
} else {
117135
pathbuf_vec![
136+
r"Z:\wi\de\Git\clangarm64\bin",
118137
r"Z:\wi\de\Git\mingw64\bin",
119138
r"Y:\nar\row\Git\mingw32\bin",
120139
r"Z:\wi\de\Git\mingw32\bin",

0 commit comments

Comments
 (0)