git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Erik Werner <martinerikwerner@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, trsten@science-computing.de
Subject: Re: [PATCH v2 3/3] t9903: add extra tests for bash.showDirtyState
Date: Wed, 13 Feb 2013 18:37:45 +0100	[thread overview]
Message-ID: <1360777065.13768.17.camel@mas> (raw)
In-Reply-To: <7vy5es9o0g.fsf@alter.siamese.dyndns.org>

On Wed, 2013-02-13 at 08:28 -0800, Junio C Hamano wrote:
> Martin Erik Werner <martinerikwerner@gmail.com> writes:
> 
> > Added 3 extra tests for the bash.showDirtyState config option, tests
> > should now cover all combinations of the shell var being set/unset and
> > the config option being enabled/disabled, given a dirty file.
> 
> Strictly speaking, you have 6 not 4 combinations (shell variable
> set/unset * config missing/set to false/set to true).  I think these
> additional tests cover should all 6 because "config missing" case
> should already have had tests before bash.showDirtyState was added.
> 

Indeed, I only mentioned 4 since the other ones existed already, and I
didn't change them, but maybe it should be mentioned as "combined with
previous tests (...) cover all 6 combinations (...)" then?

> > * Renamed test 'disabled by config' to 'shell variable set with config
> >   disabled' for consistency
> > ---
> 
> Sign-off?

Ah, just forgot the -s flag on that commit, yes it should be Signed-off
by me.

> 
> >  t/t9903-bash-prompt.sh |   38 +++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 37 insertions(+), 1 deletion(-)
> >
> > diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
> > index cb008e2..fa81b09 100755
> > --- a/t/t9903-bash-prompt.sh
> > +++ b/t/t9903-bash-prompt.sh
> > @@ -360,12 +360,48 @@ test_expect_success 'prompt - dirty status indicator - before root commit' '
> >  	test_cmp expected "$actual"
> >  '
> >  
> > -test_expect_success 'prompt - dirty status indicator - disabled by config' '
> > +test_expect_success 'prompt - dirty status indicator - shell variable unset with config disabled' '
> >  	printf " (master)" > expected &&
> >  	echo "dirty" > file &&
> >  	test_when_finished "git reset --hard" &&
> >  	test_config bash.showDirtyState false &&
> >  	(
> > +		unset -v GIT_PS1_SHOWDIRTYSTATE &&
> > +		__git_ps1 > "$actual"
> > +	) &&
> > +	test_cmp expected "$actual"
> > +'
> > +
> > +test_expect_success 'prompt - dirty status indicator - shell variable unset with config enabled' '
> > +	printf " (master)" > expected &&
> > +	echo "dirty" > file &&
> > +	test_when_finished "git reset --hard" &&
> > +	test_config bash.showDirtyState true &&
> > +	(
> > +		unset -v GIT_PS1_SHOWDIRTYSTATE &&
> > +		__git_ps1 > "$actual"
> > +	) &&
> > +	test_cmp expected "$actual"
> > +'
> > +
> > +test_expect_success 'prompt - dirty status indicator - shell variable set with config disabled' '
> > +	printf " (master)" > expected &&
> > +	echo "dirty" > file &&
> > +	test_when_finished "git reset --hard" &&
> > +	test_config bash.showDirtyState false &&
> > +	(
> > +		GIT_PS1_SHOWDIRTYSTATE=y &&
> > +		__git_ps1 > "$actual"
> > +	) &&
> > +	test_cmp expected "$actual"
> > +'
> > +
> > +test_expect_success 'prompt - dirty status indicator - shell variable set with config enabled' '
> > +	printf " (master *)" > expected &&
> > +	echo "dirty" > file &&
> > +	test_when_finished "git reset --hard" &&
> > +	test_config bash.showDirtyState true &&
> > +	(
> >  		GIT_PS1_SHOWDIRTYSTATE=y &&
> >  		__git_ps1 > "$actual"
> >  	) &&

  reply	other threads:[~2013-02-13 17:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12 20:12 [PATCH 0/2] Add bash.showUntrackedFiles config option Martin Erik Werner
2013-02-12 20:12 ` [PATCH 1/2] bash completion: add bash.showUntrackedFiles option Martin Erik Werner
2013-02-12 22:17   ` Junio C Hamano
2013-02-12 20:12 ` [PATCH 2/2] t9903: add test case for bash.showUntrackedFiles Martin Erik Werner
2013-02-12 22:29   ` Junio C Hamano
2013-02-13 10:58     ` [PATCH v2 0/3] Add bash.showUntrackedFiles config option Martin Erik Werner
2013-02-13 11:01       ` [PATCH v2 1/3] shell prompt: add bash.showUntrackedFiles option Martin Erik Werner
2013-02-13 11:01         ` [PATCH v2 2/3] t9903: add tests for bash.showUntrackedFiles Martin Erik Werner
2013-02-13 16:23           ` Junio C Hamano
2013-02-13 17:27             ` Martin Erik Werner
2013-02-13 19:51               ` Junio C Hamano
2013-02-13 11:02         ` [PATCH v2 3/3] t9903: add extra tests for bash.showDirtyState Martin Erik Werner
2013-02-13 16:28           ` Junio C Hamano
2013-02-13 17:37             ` Martin Erik Werner [this message]
2013-02-13 19:53               ` Junio C Hamano
2013-02-13 20:40                 ` Martin Erik Werner
2013-02-13 20:42                   ` Junio C Hamano
2013-02-13 20:58                     ` [PATCH v3 2/3] t9903: add tests for bash.showUntrackedFiles Martin Erik Werner
2013-02-13 20:58                       ` [PATCH v3 3/3] t9903: add extra tests for bash.showDirtyState Martin Erik Werner
2013-02-13 16:12         ` [PATCH v2 1/3] shell prompt: add bash.showUntrackedFiles option Junio C Hamano

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=1360777065.13768.17.camel@mas \
    --to=martinerikwerner@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=trsten@science-computing.de \
    /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).