From 5878ad17bc0c0d9d99b36f3ff9416cf9a47a4086 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 20 Sep 2022 07:03:49 +0800 Subject: [PATCH] a little more complexity for diff tests (#470) --- .../tests/fixtures/generated-archives/make_diff_repo.tar.xz | 4 ++-- git-repository/tests/fixtures/make_diff_repo.sh | 3 ++- git-repository/tests/object/tree.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/git-repository/tests/fixtures/generated-archives/make_diff_repo.tar.xz b/git-repository/tests/fixtures/generated-archives/make_diff_repo.tar.xz index 9f9fe388495..4a7f55cb2e0 100644 --- a/git-repository/tests/fixtures/generated-archives/make_diff_repo.tar.xz +++ b/git-repository/tests/fixtures/generated-archives/make_diff_repo.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2123aa9e3fd85166d35c02c59ce8f0e8aaa3631c3dd4e43468f98d26cddf049c -size 11128 +oid sha256:a057f8e02b4fa2743d74c84a68ace9ce2c3a051527afa8d9a5cb671b48e36868 +size 11272 diff --git a/git-repository/tests/fixtures/make_diff_repo.sh b/git-repository/tests/fixtures/make_diff_repo.sh index 431c02138a1..4b0a0fb7e49 100644 --- a/git-repository/tests/fixtures/make_diff_repo.sh +++ b/git-repository/tests/fixtures/make_diff_repo.sh @@ -5,13 +5,14 @@ git init -q git checkout -b main mkdir dir -touch a b dir/c +touch a b dir/c d git add . git commit -q -m c1 echo a >> a echo b >> b echo dir/c >> dir/c +echo d >> d git commit -q -am c2 echo a1 >> a diff --git a/git-repository/tests/object/tree.rs b/git-repository/tests/object/tree.rs index f621460707a..e360d98ac60 100644 --- a/git-repository/tests/object/tree.rs +++ b/git-repository/tests/object/tree.rs @@ -52,7 +52,7 @@ mod diff { ); let to = tree_named(&repo, ":/c1"); - let mut expected = vec!["a", "b", "c"]; + let mut expected = vec!["a", "b", "c", "d"]; from.changes() .track_filename() .for_each_to_obtain_tree(&to, |change| -> Result<_, Infallible> { @@ -62,7 +62,7 @@ mod diff { .unwrap(); assert_eq!(expected, Vec::<&str>::new(), "all paths should have been seen"); - let mut expected = vec!["a", "b", "dir/c"]; + let mut expected = vec!["a", "b", "dir/c", "d"]; from.changes() .track_path() .for_each_to_obtain_tree(&to, |change| -> Result<_, Infallible> {