Skip to content

Commit d68fcce

Browse files
committed
Merge branch 'ab/test-lib'
Test framework clean-up. * ab/test-lib: test-lib-functions: assert correct parameter count test-lib-functions: remove bug-inducing "diagnostics" helper param test libs: rename "diff-lib" to "lib-diff" t/.gitattributes: sort lines test-lib-functions: move function to lib-bitmap.sh test libs: rename gitweb-lib.sh to lib-gitweb.sh test libs: rename bundle helper to "lib-bundle.sh" test-lib-functions: remove generate_zero_bytes() wrapper test-lib-functions: move test_set_index_version() to its user test lib: change "error" to "BUG" as appropriate test-lib: remove check_var_migration
2 parents 45df6c4 + e7884b3 commit d68fcce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+107
-124
lines changed

t/.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
t[0-9][0-9][0-9][0-9]/* -whitespace
22
/chainlint/*.expect eol=lf
3-
/diff-lib/* eol=lf
3+
/lib-diff/* eol=lf
44
/t0110/url-* binary
55
/t3206/* eol=lf
66
/t3900/*.txt eol=lf
77
/t3901/*.txt eol=lf
8-
/t4034/*/* eol=lf
98
/t4013/* eol=lf
109
/t4018/* eol=lf
10+
/t4034/*/* eol=lf
1111
/t4051/* eol=lf
1212
/t4100/* eol=lf
1313
/t4101/* eol=lf

t/README

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -917,13 +917,13 @@ library for your script to use.
917917

918918
Check whether a file has the length it is expected to.
919919

920-
- test_path_is_file <path> [<diagnosis>]
921-
test_path_is_dir <path> [<diagnosis>]
922-
test_path_is_missing <path> [<diagnosis>]
920+
- test_path_is_file <path>
921+
test_path_is_dir <path>
922+
test_path_is_missing <path>
923923

924924
Check if the named path is a file, if the named path is a
925925
directory, or if the named path does not exist, respectively,
926-
and fail otherwise, showing the <diagnosis> text.
926+
and fail otherwise.
927927

928928
- test_when_finished <script>
929929

t/lib-bitmap.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Compare a file containing rev-list bitmap traversal output to its non-bitmap
2+
# counterpart. You can't just use test_cmp for this, because the two produce
3+
# subtly different output:
4+
#
5+
# - regular output is in traversal order, whereas bitmap is split by type,
6+
# with non-packed objects at the end
7+
#
8+
# - regular output has a space and the pathname appended to non-commit
9+
# objects; bitmap output omits this
10+
#
11+
# This function normalizes and compares the two. The second file should
12+
# always be the bitmap output.
13+
test_bitmap_traversal () {
14+
if test "$1" = "--no-confirm-bitmaps"
15+
then
16+
shift
17+
elif cmp "$1" "$2"
18+
then
19+
echo >&2 "identical raw outputs; are you sure bitmaps were used?"
20+
return 1
21+
fi &&
22+
cut -d' ' -f1 "$1" | sort >"$1.normalized" &&
23+
sort "$2" >"$2.normalized" &&
24+
test_cmp "$1.normalized" "$2.normalized" &&
25+
rm -f "$1.normalized" "$2.normalized"
26+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

t/t2104-update-index-skip-worktree.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ test_description='skip-worktree bit test'
99

1010
sane_unset GIT_TEST_SPLIT_INDEX
1111

12+
test_set_index_version () {
13+
GIT_INDEX_VERSION="$1"
14+
export GIT_INDEX_VERSION
15+
}
16+
1217
test_set_index_version 3
1318

1419
cat >expect.full <<EOF

t/t3404-rebase-interactive.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ test_expect_success 'rebase -i with the exec command' '
101101
) &&
102102
test_path_is_file touch-one &&
103103
test_path_is_file touch-two &&
104-
test_path_is_missing touch-three " (should have stopped before)" &&
104+
# Missing because we should have stopped by now.
105+
test_path_is_missing touch-three &&
105106
test_cmp_rev C HEAD &&
106107
git rebase --continue &&
107108
test_path_is_file touch-three &&

0 commit comments

Comments
 (0)