Skip to content

Commit 5df0cf5

Browse files
committed
Improve expect and assert messages in PathsByRole::validate()
1 parent a5a5342 commit 5df0cf5

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

gix-path/src/env/git.rs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,14 @@ mod tests {
255255
assert_eq!(
256256
pf_current.as_os_str(),
257257
pf_x86.as_os_str(),
258-
"Ours is identical to 32-bit path."
258+
"Our program files path is exactly identical to the 32-bit one.",
259259
);
260260
for arch_suffix in [" (x86)", " (Arm)"] {
261261
let has_arch_suffix = ends_with_case_insensitive(pf_current.as_os_str(), arch_suffix)
262-
.expect("Assume the test systems key dirs are valid Unicode.");
262+
.expect("Assume the test system's important directories are valid Unicode.");
263263
assert!(
264264
!has_arch_suffix,
265-
"32-bit program files on 32-bit system has unadorned name."
265+
"The 32-bit program files directory name on a 32-bit system mentions no architecture.",
266266
);
267267
}
268268
maybe_pf_64bit
@@ -273,19 +273,29 @@ mod tests {
273273
assert_eq!(
274274
pf_current.as_os_str(),
275275
pf_x86.as_os_str(),
276-
"Ours is identical to 32-bit path."
276+
"Our program files path is exactly identical to the 32-bit one.",
277+
);
278+
let pf_64bit = maybe_pf_64bit
279+
.as_ref()
280+
.expect("The 64-bit program files directory exists.");
281+
assert_ne!(
282+
&pf_x86, pf_64bit,
283+
"The 32-bit and 64-bit program files directories have different locations.",
277284
);
278-
let pf_64bit = maybe_pf_64bit.as_ref().expect("64-bit program files exists.");
279-
assert_ne!(&pf_x86, pf_64bit, "32-bit and 64-bit program files directories differ.");
280285
}
281286
PlatformArchitecture::Is64on64 => {
282-
let pf_64bit = maybe_pf_64bit.as_ref().expect("64-bit program files exists.");
287+
let pf_64bit = maybe_pf_64bit
288+
.as_ref()
289+
.expect("The 64-bit program files directory exists.");
283290
assert_eq!(
284291
pf_current.as_os_str(),
285292
pf_64bit.as_os_str(),
286-
"Ours is identical to 64-bit path."
293+
"Our program files path is exactly identical to the 64-bit one.",
294+
);
295+
assert_ne!(
296+
&pf_x86, pf_64bit,
297+
"The 32-bit and 64-bit program files directories have different locations.",
287298
);
288-
assert_ne!(&pf_x86, pf_64bit, "32-bit and 64-bit program files directories differ.");
289299
}
290300
}
291301

0 commit comments

Comments
 (0)