History

refactor

Sebastian Thiel committed 4 years ago

Commit b2835cc1 parent f5959ed4 files · +15 −16Browse files

Unified · Split

4 files
  1. git-index/tests/fixtures/generated-archives/v2_all_file_kinds.tar.xz +1 −1
  2. git-index/tests/fixtures/make_index/v2_all_file_kinds.sh +6 −7
  3. git-index/tests/index/init.rs +2 −2
  4. git-pathspec/tests/pathspec.rs +6 −6
git-index/tests/fixtures/generated-archives/v2_all_file_kinds.tar.xz+1−1
@@ -1,3 +1,3 @@
1version https://git-lfs.github.com/spec/v11version https://git-lfs.github.com/spec/v1
2oid sha256:2b034a569959fd83c39e7aa870fea63b5fd8b87b5665e65881fade92592fc2c32oid sha256:5acb6a5de229b312880af9847cefa54ccb8385f4273f0bb365f2af66dd789f0f
3size 110403size 11040
git-index/tests/fixtures/make_index/v2_all_file_kinds.sh+6−7
@@ -4,13 +4,12 @@ set -eu -o pipefail · 3 unmodified lines
4export GIT_INDEX_VERSION=2;4export GIT_INDEX_VERSION=2;
5 5
6git init -q sub6git init -q sub
7cd sub7(cd sub
8 8
9touch a b c9 touch a b c
10git add .10 git add .
11git commit -m "empty"11 git commit -m "init"
12 12)
13cd ..
14 13
15git init -q14git init -q
16git config index.threads 115git config index.threads 1
@@ -22,4 +21,4 @@ mkdir d · 5 unmodified lines
22(cd d && touch a b c)21(cd d && touch a b c)
23 22
24git add .23git add .
25git commit -m "empty"24git commit -m "init"
git-index/tests/index/init.rs+2−2
@@ -38,10 +38,10 @@ fn compare_states(actual: &State, expected: &State, fixture: &str) { · 37 unmodified lines
38 fixture38 fixture
39 );39 );
40 40
41 actual.entries().iter().zip(expected.entries()).for_each(|(a, e)| {41 for (a, e) in actual.entries().iter().zip(expected.entries()) {
42 assert_eq!(a.id, e.id, "entry id mismatch in {:?}", fixture);42 assert_eq!(a.id, e.id, "entry id mismatch in {:?}", fixture);
43 assert_eq!(a.flags, e.flags, "entry flags mismatch in {:?}", fixture);43 assert_eq!(a.flags, e.flags, "entry flags mismatch in {:?}", fixture);
44 assert_eq!(a.mode, e.mode, "entry mode mismatch in {:?}", fixture);44 assert_eq!(a.mode, e.mode, "entry mode mismatch in {:?}", fixture);
45 assert_eq!(a.path(actual), e.path(expected), "entry path mismatch in {:?}", fixture);45 assert_eq!(a.path(actual), e.path(expected), "entry path mismatch in {:?}", fixture);
46 })46 }
47}47}
git-pathspec/tests/pathspec.rs+6−6
@@ -284,7 +284,7 @@ mod parse { · 283 unmodified lines
284 ":_()", ":`()", ":~()",284 ":_()", ":`()", ":~()",
285 ];285 ];
286 286
287 inputs.into_iter().for_each(|input| {287 for input in inputs.into_iter() {
288 assert!(288 assert!(
289 !check_against_baseline(input),289 !check_against_baseline(input),
290 "This pathspec is valid in git: {}",290 "This pathspec is valid in git: {}",
@@ -294,7 +294,7 @@ mod parse { · 3 unmodified lines
294 let output = git_pathspec::parse(input.as_bytes());294 let output = git_pathspec::parse(input.as_bytes());
295 assert!(output.is_err());295 assert!(output.is_err());
296 assert!(matches!(output.unwrap_err(), Error::Unimplemented { .. }));296 assert!(matches!(output.unwrap_err(), Error::Unimplemented { .. }));
297 });297 }
298 }298 }
299 299
300 #[test]300 #[test]
@@ -306,7 +306,7 @@ mod parse { · 5 unmodified lines
306 ":(top,exclude,icse)some/path",306 ":(top,exclude,icse)some/path",
307 ];307 ];
308 308
309 inputs.into_iter().for_each(|input| {309 for input in inputs.into_iter() {
310 assert!(310 assert!(
311 !check_against_baseline(input),311 !check_against_baseline(input),
312 "This pathspec is valid in git: {}",312 "This pathspec is valid in git: {}",
@@ -316,7 +316,7 @@ mod parse { · 3 unmodified lines
316 let output = git_pathspec::parse(input.as_bytes());316 let output = git_pathspec::parse(input.as_bytes());
317 assert!(output.is_err());317 assert!(output.is_err());
318 assert!(matches!(output.unwrap_err(), Error::InvalidKeyword { .. }));318 assert!(matches!(output.unwrap_err(), Error::InvalidKeyword { .. }));
319 });319 }
320 }320 }
321 321
322 #[test]322 #[test]
@@ -454,7 +454,7 @@ mod parse { · 131 unmodified lines
454 }454 }
455 455
456 fn check_valid_inputs<'a>(inputs: impl IntoIterator<Item = (&'a str, PatternForTesting)>) {456 fn check_valid_inputs<'a>(inputs: impl IntoIterator<Item = (&'a str, PatternForTesting)>) {
457 inputs.into_iter().for_each(|(input, expected)| {457 for (input, expected) in inputs.into_iter() {
458 assert!(458 assert!(
459 check_against_baseline(input),459 check_against_baseline(input),
460 "This pathspec is invalid in git: {}",460 "This pathspec is invalid in git: {}",
@@ -465,7 +465,7 @@ mod parse { · 4 unmodified lines
465 .unwrap_or_else(|_| panic!("parsing should not fail with pathspec {}", input))465 .unwrap_or_else(|_| panic!("parsing should not fail with pathspec {}", input))
466 .into();466 .into();
467 assert_eq!(pattern, expected, "while checking input: \"{}\"", input);467 assert_eq!(pattern, expected, "while checking input: \"{}\"", input);
468 });468 }
469 }469 }
470 470
471 fn pat_with_path(path: &str) -> PatternForTesting {471 fn pat_with_path(path: &str) -> PatternForTesting {