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: [PATCH v2 0/3] Add bash.showUntrackedFiles config option
Date: Wed, 13 Feb 2013 11:58:58 +0100	[thread overview]
Message-ID: <1360753138.25490.10.camel@mas> (raw)
In-Reply-To: <7vr4kldv2x.fsf@alter.siamese.dyndns.org>

On Tue, 2013-02-12 at 14:29 -0800, Junio C Hamano wrote:
> Martin Erik Werner <martinerikwerner@gmail.com> writes:
> 
> > Add a test case for the bash.showUntrackedFiles config option, which
> > checks that the config option can disable the global effect of the
> > GIT_PS1_SHOWUNTRACKEDFILES environmant variable.
> >
> > Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
> > ---
> >  t/t9903-bash-prompt.sh |   11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
> > index f17c1f8..c9417b9 100755
> > --- a/t/t9903-bash-prompt.sh
> > +++ b/t/t9903-bash-prompt.sh
> > @@ -447,6 +447,17 @@ test_expect_success 'prompt - untracked files status indicator - not shown insid
> >  	test_cmp expected "$actual"
> >  '
> >  
> > +test_expect_success 'prompt - untracked files status indicator - disabled by config' '
> > +	printf " (master)" > expected &&
> > +	echo "untracked" > file_untracked &&
> > +	test_config bash.showUntrackedFiles false &&
> > +	(
> > +		GIT_PS1_SHOWUNTRACKEDFILES=y &&
> > +		__git_ps1 > "$actual"
> > +	) &&
> > +	test_cmp expected "$actual"
> > +'
> 
> All six combinations need checking:
> 
>  * not having the configuration at all and not having the shell
>    variable should not show the untracked indicator (already tested).
> 
>  * not having the configuration at all and having the shell variable
>    should show the untracked indicator (already tested).
> 
>  * setting configuration to true without having the shell variable
>    should not show the untracked indicator.
> 
>  * setting configuration to true and having the shell variable
>    should show the unttracked indicator.
> 
>  * setting configuration to false and having the shell variable
>    should not show the untracked indicator (the above test checks
>    this).
> 
>  * setting configuration to false without having the shell variable
>    should not show the untracked indicator.
> 
> to prevent others from breaking the code you wrote for [PATCH 1/2],
> so you need three more tests, I guess?

Ah, yes, I was mimicing what the test did for bash.showDirtyState, I've
now added the three extra tests for bash.showUntrackedFiles, which
should cover all of the above cases, hopefully?

I've also added in the three extra tests for bash.showDirtyState,
equivalently. These only cover the case of dirty files and not
combinations with content in index, which I felt was a bit overkill, is
that reasonable?

Thanks for the review :)

-- 
Martin Erik Werner <martinerikwerner@gmail.com>

  reply	other threads:[~2013-02-13 10:59 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     ` Martin Erik Werner [this message]
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
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=1360753138.25490.10.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).