diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t0000-basic.sh | 7 | ||||
-rwxr-xr-x | t/t1302-repo-version.sh | 2 | ||||
-rwxr-xr-x | t/t1500-rev-parse.sh | 2 | ||||
-rwxr-xr-x | t/t4044-diff-index-unique-abbrev.sh | 4 | ||||
-rwxr-xr-x | t/t5313-pack-bounds-checks.sh | 2 | ||||
-rw-r--r-- | t/test-lib-functions.sh | 2 |
6 files changed, 10 insertions, 9 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 ' diff --git a/t/t1302-repo-version.sh b/t/t1302-repo-version.sh index 0acabb6d11..7cf80bf66a 100755 --- a/t/t1302-repo-version.sh +++ b/t/t1302-repo-version.sh @@ -27,7 +27,7 @@ test_expect_success 'setup' ' ' test_expect_success 'gitdir selection on normal repos' ' - echo $(test_oid version) >expect && + test_oid version >expect && git config core.repositoryformatversion >actual && git -C test config core.repositoryformatversion >actual2 && test_cmp expect actual && diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh index 81de584ea2..37ee5091b5 100755 --- a/t/t1500-rev-parse.sh +++ b/t/t1500-rev-parse.sh @@ -195,7 +195,7 @@ test_expect_success 'rev-parse --is-shallow-repository in non-shallow repo' ' ' test_expect_success 'rev-parse --show-object-format in repo' ' - echo "$(test_oid algo)" >expect && + test_oid algo >expect && git rev-parse --show-object-format >actual && test_cmp expect actual && git rev-parse --show-object-format=storage >actual && diff --git a/t/t4044-diff-index-unique-abbrev.sh b/t/t4044-diff-index-unique-abbrev.sh index 29e49d2290..9f6043daba 100755 --- a/t/t4044-diff-index-unique-abbrev.sh +++ b/t/t4044-diff-index-unique-abbrev.sh @@ -34,12 +34,12 @@ test_expect_success 'setup' ' 100644 blob $(test_oid hash2) foo EOF - echo "$(test_oid val1)" > foo && + test_oid val1 > foo && git add foo && git commit -m "initial" && git cat-file -p HEAD: > actual && test_cmp expect_initial actual && - echo "$(test_oid val2)" > foo && + test_oid val2 > foo && git commit -a -m "update" && git cat-file -p HEAD: > actual && test_cmp expect_update actual diff --git a/t/t5313-pack-bounds-checks.sh b/t/t5313-pack-bounds-checks.sh index cc4cfaa9d3..ceaa6700a2 100755 --- a/t/t5313-pack-bounds-checks.sh +++ b/t/t5313-pack-bounds-checks.sh @@ -59,7 +59,7 @@ test_expect_success 'setup' ' test_expect_success 'set up base packfile and variables' ' # the hash of this content starts with ff, which # makes some later computations much simpler - echo $(test_oid oidfff) >file && + test_oid oidfff >file && git add file && git commit -m base && git repack -ad && diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 796093a7b3..f51b97663f 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -1682,7 +1682,7 @@ test_oid () { then BUG "undefined key '$1'" fi && - eval "printf '%s' \"\${$var}\"" + eval "printf '%s\n' \"\${$var}\"" } # Insert a slash into an object ID so it can be used to reference a location |