Re: [PATCH v2 08/10] t6050: add tests for listing with --format
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Dec 9, 2013, 03:19 UTC
- Message-ID
- <CAPig+cTcacoNGstYeYRd3_WKAP6=ga7gV4puSsr7c2sO_OMNTQ@mail.gmail.com>
- In-Reply-To
- <20131207162106.21478.8850.chriscool@tuxfamily.org>
On Sat, Dec 7, 2013 at 11:21 AM, Christian Couder <chriscool@tuxfamily.org> wrote:
> This patch adds tests for "git replace -l --format=<fmt>". > Only tests when <fmt> is 'medium' and 'full' are needed > because 'short' is the same as with no --format option.
Nevertheless, don't you want to test that it behaves in the expected manner when given --format=short and other legal or illegal combinations?
--format --format short --format bogus ...etc...
Show 51 quoted lines
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
> t/t6050-replace.sh | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
> index bb785ec..3627b4c 100755
> --- a/t/t6050-replace.sh
> +++ b/t/t6050-replace.sh
> @@ -281,6 +281,33 @@ test_expect_success 'git cat-file --batch works on replace objects' '
> echo $PARA3 | git cat-file --batch
> '
>
> +test_expect_success 'test --format medium' '
> + H1=$(git --no-replace-objects rev-parse HEAD~1) &&
> + HT=$(git --no-replace-objects rev-parse HEAD^{tree}) &&
> + MYTAG=$(git --no-replace-objects rev-parse mytag) &&
> + {
> + echo "$H1 -> $BLOB" &&
> + echo "$BLOB -> $REPLACED" &&
> + echo "$HT -> $H1" &&
> + echo "$PARA3 -> $S" &&
> + echo "$MYTAG -> $HASH1"
> + } | sort >expected &&
> + git replace -l --format medium | sort > actual &&
> + test_cmp expected actual
> +'
> +
> +test_expect_failure 'test --format full' '
> + {
> + echo "$H1 (commit) -> $BLOB (blob)" &&
> + echo "$BLOB (blob) -> $REPLACED (blob)" &&
> + echo "$HT (tree) -> $H1 (commit)" &&
> + echo "$PARA3 (commit) -> $S (commit)" &&
> + echo "$MYTAG (tag) -> $HASH1 (commit)"
> + } | sort >expected &&
> + git replace --format=full | sort > actual &&
> + test_cmp expected actual
> +'
> +
> test_expect_success 'replace ref cleanup' '
> test -n "$(git replace)" &&
> git replace -d $(git replace) &&
> --
> 1.8.5.1.102.g090758b
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html