diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-01-05 15:07:18 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-01-05 15:07:19 +0900 |
| commit | 6f212b7c3f01fbdcef07e8076e877c5a8e2d33f2 (patch) | |
| tree | 7b26af2c658fbab65ed076a48ff3e026513de67b /t/t0000-basic.sh | |
| parent | 3eac69d2677431803ea696f73fe33d44fbb6c214 (diff) | |
| parent | a48a88019b408157cf3b76e1a198afd824f4f0a3 (diff) | |
| download | git-6f212b7c3f01fbdcef07e8076e877c5a8e2d33f2.tar.xz | |
Merge branch 'sg/test-oid-wo-incomplete-line'
Test helper updates.
* sg/test-oid-wo-incomplete-line:
tests: make 'test_oid' print trailing newline
Diffstat (limited to 't/t0000-basic.sh')
| -rwxr-xr-x | t/t0000-basic.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 502b4bcf9e..8ea31d187a 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -815,7 +815,8 @@ test_expect_success 'test_oid provides sane info by default' ' grep "^00*\$" actual && rawsz="$(test_oid rawsz)" && hexsz="$(test_oid hexsz)" && - test "$hexsz" -eq $(wc -c <actual) && + # +1 accounts for the trailing newline + test $(( $hexsz + 1)) -eq $(wc -c <actual) && test $(( $rawsz * 2)) -eq "$hexsz" ' @@ -826,7 +827,7 @@ test_expect_success 'test_oid can look up data for SHA-1' ' grep "^00*\$" actual && rawsz="$(test_oid rawsz)" && hexsz="$(test_oid hexsz)" && - test $(wc -c <actual) -eq 40 && + test $(wc -c <actual) -eq 41 && test "$rawsz" -eq 20 && test "$hexsz" -eq 40 ' @@ -838,7 +839,7 @@ test_expect_success 'test_oid can look up data for SHA-256' ' grep "^00*\$" actual && rawsz="$(test_oid rawsz)" && hexsz="$(test_oid hexsz)" && - test $(wc -c <actual) -eq 64 && + test $(wc -c <actual) -eq 65 && test "$rawsz" -eq 32 && test "$hexsz" -eq 64 ' |
