Skip to content

Commit 323f52f

Browse files
committed
Divide up locations_under_program_files_* assertions
This splits the `locations_under_program_files_ordinary` and `locations_under_program_files_strange` test cases, each of which contained multiple assertions, into multiple more specific test cases, each of which is named more descriptively and contains exactly one assertion.
1 parent daaf5ec commit 323f52f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ mod locations {
5050
}
5151

5252
#[test]
53-
fn locations_under_program_files_ordinary() {
53+
fn locations_under_program_files_ordinary_current_var_only() {
5454
assert_eq!(
5555
locations_from!(
5656
"ProgramFiles" => r"C:\Program Files",
@@ -64,6 +64,10 @@ mod locations {
6464
pathbuf_vec![r"C:\Program Files\Git\mingw32\bin"]
6565
},
6666
);
67+
}
68+
69+
#[test]
70+
fn locations_under_program_files_ordinary_all_vars() {
6771
assert_eq!(
6872
locations_from!(
6973
"ProgramFiles" => {
@@ -82,11 +86,15 @@ mod locations {
8286
r"C:\Program Files (x86)\Git\mingw32\bin",
8387
],
8488
);
89+
}
90+
91+
#[test]
92+
fn locations_under_program_files_ordinary_no_vars() {
8593
assert_eq!(locations_from!(), Vec::<PathBuf>::new());
8694
}
8795

8896
#[test]
89-
fn locations_under_program_files_strange() {
97+
fn locations_under_program_files_strange_all_vars_distinct() {
9098
assert_eq!(
9199
locations_from!(
92100
"ProgramFiles" => r"X:\cur\rent",
@@ -110,12 +118,20 @@ mod locations {
110118
]
111119
},
112120
);
121+
}
122+
123+
#[test]
124+
fn locations_under_program_files_strange_64bit_var_only() {
113125
assert_eq!(
114126
locations_from!(
115127
"ProgramW6432" => r"Z:\wi\de",
116128
),
117129
pathbuf_vec![r"Z:\wi\de\Git\clangarm64\bin", r"Z:\wi\de\Git\mingw64\bin"],
118130
);
131+
}
132+
133+
#[test]
134+
fn locations_under_program_files_strange_all_vars_path_cruft() {
119135
assert_eq!(
120136
locations_from!(
121137
"ProgramFiles" => r"Z:/wi//de/",
@@ -137,6 +153,10 @@ mod locations {
137153
]
138154
},
139155
);
156+
}
157+
158+
#[test]
159+
fn locations_under_program_files_strange_some_relative() {
140160
assert_eq!(
141161
locations_from!(
142162
"ProgramFiles" => r"foo\bar",

0 commit comments

Comments
 (0)