History

more descriptive test names (#331)

Sebastian Thiel committed 4 years ago

Commit 049b2431 parent ae4f1221 file · +9 −9Browse files

Unified · Split

git-config/src/values.rs+9−9
@@ -382,13 +382,13 @@ pub mod path { · 381 unmodified lines
382382 }
383383
384384 #[cfg(test)]
385− mod tests {
385+ mod interpolate_tests {
386386 use std::borrow::Cow;
387387
388388 use crate::values::{path::interpolate::Error, Path};
389389
390390 #[test]
391− fn not_interpolated() {
391+ fn no_interpolation_for_paths_without_tilde_or_prefix() {
392392 let path = &b"/foo/bar"[..];
393393 let actual = Path::from(Cow::Borrowed(path));
394394 assert_eq!(&*actual, path);
@@ -399,7 +399,7 @@ pub mod path { · 4 unmodified lines
399399 }
400400
401401 #[test]
402− fn empty_is_error() {
402+ fn empty_path_is_error() {
403403 assert!(matches!(
404404 Path::from(Cow::Borrowed("".as_bytes())).interpolate(None),
405405 Err(Error::Missing { what: "path" })
@@ -407,7 +407,7 @@ pub mod path { · 1 unmodified line
407407 }
408408
409409 #[test]
410− fn prefix_interpolated() {
410+ fn prefix_substitutes_git_install_dir() {
411411 for git_install_dir in &["/tmp/git", "C:\\git"] {
412412 for (val, expected) in &[
413413 (&b"%(prefix)/foo/bar"[..], "foo/bar"),
@@ -431,7 +431,7 @@ pub mod path { · 17 unmodified lines
431431 }
432432
433433 #[test]
434− fn disabled_prefix_interpolation() {
434+ fn prefix_substitution_skipped_with_dot_slash() {
435435 let path = "./%(prefix)/foo/bar";
436436 let git_install_dir = "/tmp/git";
437437 assert_eq!(
@@ -443,7 +443,7 @@ pub mod path { · 5 unmodified lines
443443 }
444444
445445 #[test]
446− fn tilde_interpolated() {
446+ fn tilde_substitutes_current_user() {
447447 let path = &b"~/foo/bar"[..];
448448 let expected = format!(
449449 "{}{}foo/bar",
@@ -459,16 +459,16 @@ pub mod path { · 9 unmodified lines
459459
460460 #[cfg(target_os = "windows")]
461461 #[test]
462− fn user_interpolated() {
462+ fn tilde_with_given_user_is_unsupported_on_windows() {
463463 assert!(matches!(
464464 Path::from(Cow::Borrowed(&b"~baz/foo/bar"[..])).interpolate(None),
465− Err(path::interpolate::Error::UserInterpolationUnsupported)
465+ Err(Error::UserInterpolationUnsupported)
466466 ));
467467 }
468468
469469 #[cfg(not(target_os = "windows"))]
470470 #[test]
471− fn user_interpolated() {
471+ fn tilde_with_given_user() {
472472 let user = std::env::var("USER").unwrap();
473473 let home = std::env::var("HOME").unwrap();
474474 let specific_user_home = format!("~{}", user);