All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Maxim Bublis <satori@yandex-team.ru>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] t9300: test filedelete root
Date: Thu, 28 Aug 2014 15:30:41 -0700	[thread overview]
Message-ID: <xmqqa96o8cxa.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1409237674-74185-2-git-send-email-satori@yandex-team.ru> (Maxim Bublis's message of "Thu, 28 Aug 2014 18:54:33 +0400")

Maxim Bublis <satori@yandex-team.ru> writes:

> Add new fast-import test series for filedelete command.
>
> Signed-off-by: Maxim Bublis <satori@yandex-team.ru>
> ---

You may have been concentrating on the "delete root" case, but as
long as you claim "We add a series to test filedelete command", it
would be sensible to test more typical cases of deleting files, not
the entire tree as well, no?  Perhaps add three paths in the initial
commit e.g. hello.c, good/night.txt and good/bye.txt, first remove
good/night.txt and validate the result, then remove good/ directory
and validate the result, and finally remove the whole thing and
validate the result, or something like that?

In a patch series that introduces a demonstration of existing
breakage and then fixes the breakage in a separate patch, mark the
test that shows the known breakage with test_expect_failure and then
turn that line into test_expect_success in the later patch that
fixes the breakage.

What the test checks and the fix in 2/2 both looked sensible from a
cursory read.

Thanks.

>  t/t9300-fast-import.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
>
> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
> index 5fc9ef2..3d557b3 100755
> --- a/t/t9300-fast-import.sh
> +++ b/t/t9300-fast-import.sh
> @@ -3017,4 +3017,50 @@ test_expect_success 'T: empty reset doesnt delete branch' '
>  	git rev-parse --verify refs/heads/not-to-delete
>  '
>  
> +###
> +### series U (filedelete)
> +###
> +
> +cat >input <<INPUT_END
> +commit refs/heads/U
> +committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
> +data <<COMMIT
> +test setup
> +COMMIT
> +M 100644 inline hello.c
> +data <<BLOB
> +blob 1
> +BLOB
> +
> +INPUT_END
> +
> +test_expect_success 'U: initialize for U tests' '
> +	git fast-import <input
> +'
> +
> +cat >input <<INPUT_END
> +commit refs/heads/U
> +committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
> +data <<COMMIT
> +must succeed
> +COMMIT
> +from refs/heads/U^0
> +D ""
> +
> +INPUT_END
> +
> +test_expect_success 'U: filedelete root succeeds' '
> +    git fast-import <input
> +'
> +
> +cat >expect <<EOF
> +:100644 000000 c18147dc648481eeb65dc5e66628429a64843327 0000000000000000000000000000000000000000 D	hello.c
> +EOF
> +
> +git diff-tree -M -r U^1 U >actual
> +
> +test_expect_success 'U: validate filedelete result' '
> +	compare_diff_raw expect actual
> +'
> +
>  test_done

  reply	other threads:[~2014-08-28 22:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 14:54 [PATCH 0/2] fast-import: fix segfault and tests Maxim Bublis
2014-08-28 14:54 ` [PATCH 1/2] t9300: test filedelete root Maxim Bublis
2014-08-28 22:30   ` Junio C Hamano [this message]
2014-08-29 11:37     ` Maxim Bublis
2014-08-28 14:54 ` [PATCH 2/2] fast-import: fix segfault in store_tree() Maxim Bublis
2014-08-28 23:16   ` Junio C Hamano
2014-08-29 11:40     ` Maxim Bublis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa96o8cxa.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=satori@yandex-team.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.