git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v0 2/3] t/t3400-rebase.sh: add more tests to help migrating git-rebase.sh to C
Date: Thu, 21 May 2009 07:22:37 -0700	[thread overview]
Message-ID: <7vr5yibknm.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1242899229-27603-2-git-send-email-pclouds@gmail.com> ("Nguyễn Thái Ngọc Duy"'s message of "Thu\, 21 May 2009 19\:47\:08 +1000")

Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:

> +test_expect_success 'rebase on dirty worktree' '
> +     echo dirty >> A &&
> +     ! git rebase master'

It is a good defensive way to use "test_must_fail" instead of "!" when
testing git itself; test_must_fail does not allow the program to terminate
with non-zero value by segfaulting, while "!" does.

> +test_expect_success 'rebase on dirty cache' '
> +     git add  A &&

Two-spaces?

> +     ! git rebase master'
> +
>  test_expect_success 'rebase against master' '
> +     git reset HEAD &&
> +     git checkout -f &&

Hmm, why not "reset --hard HEAD".  Not asking to change (yet), but just
asking if there is a reason.

>       git rebase master'
>  
> +test_expect_success 'rebase against master twice' '
> +	git rebase master 2>&1|grep "Current branch my-topic-branch is up to date\\."
> +'
> +
> +test_expect_success 'rebase against master twice with --force' '
> +	git rebase --force-rebase master 2>&1|grep "Current branch my-topic-branch is up to date, rebase forced"

Do not to use any pipe while testing, i.e.

	git rebase >out 2>err &&
        grep "what you expect in 'out'" out &&
        grep "what you expect in 'err'" err

so that you can catch exit status from the command you placed in the
upstream of the pipe.

  parent reply	other threads:[~2009-05-21 14:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-21  9:47 [PATCH v0 1/3] doc/git-rebase.txt: remove mention of multiple strategies Nguyễn Thái Ngọc Duy
2009-05-21  9:47 ` [PATCH v0 2/3] t/t3400-rebase.sh: add more tests to help migrating git-rebase.sh to C Nguyễn Thái Ngọc Duy
2009-05-21  9:47   ` [PATCH v0 3/3] Build in git-rebase.sh Nguyễn Thái Ngọc Duy
2009-05-21 10:25     ` Jakub Narebski
2009-05-21 10:44       ` Nguyen Thai Ngoc Duy
2009-05-21 12:29         ` Jakub Narebski
2009-05-21 22:57           ` Nguyen Thai Ngoc Duy
2009-05-21 14:39     ` Junio C Hamano
2009-05-22  6:56     ` Johannes Sixt
2009-05-22  7:30       ` Nguyen Thai Ngoc Duy
2009-05-23  9:26         ` Nguyen Thai Ngoc Duy
2009-05-23 14:50           ` Nguyen Thai Ngoc Duy
2009-05-25  6:16             ` Johannes Sixt
2009-05-25  6:34               ` Nguyen Thai Ngoc Duy
2009-05-25  6:47                 ` Johannes Sixt
2009-05-25  7:00                   ` Nguyen Thai Ngoc Duy
2009-05-25  7:39                     ` Nguyen Thai Ngoc Duy
2009-05-21 10:22   ` [PATCH v0 2/3] t/t3400-rebase.sh: add more tests to help migrating git-rebase.sh to C Jakub Narebski
2009-05-21 10:39     ` Nguyen Thai Ngoc Duy
2009-05-21 14:22   ` Junio C Hamano [this message]
2009-05-23 15:31     ` [PATCH " Nguyễn Thái Ngọc Duy

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=7vr5yibknm.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).