git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Eduardo R. D'Avila" <erdavila@gmail.com>
To: git@vger.kernel.org
Cc: "SZEDER Gábor" <szeder@ira.uka.de>,
	gitster@pobox.com, "Eduardo R. D'Avila" <erdavila@gmail.com>
Subject: [PATCH v2 3/5] t9903: remove redundant tests
Date: Wed, 26 Jun 2013 00:05:15 -0300	[thread overview]
Message-ID: <5f56853a746189ccb03b929d472b5a5e721f8fb7.1372211661.git.erdavila@gmail.com> (raw)
In-Reply-To: <cover.1372211661.git.erdavila@gmail.com>
In-Reply-To: <cover.1372211661.git.erdavila@gmail.com>

After refactoring __git_ps1_colorize_gitstring, codepaths for bash and zsh
became mostly common and tests for bash and zsh became redundant.

Remove tests for zsh. Keep one minimal test that stress the difference
in codepaths for bash and zsh.

Suggested-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com>
---
1	114	t/t9903-bash-prompt.sh
 t/t9903-bash-prompt.sh | 115 +------------------------------------------------
 1 file changed, 1 insertion(+), 114 deletions(-)

diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 6a88778..f250dfc 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -665,7 +665,7 @@ test_expect_success 'prompt - bash color pc mode - untracked files status indica
 	test_cmp expected "$actual"
 '
 
-test_expect_success 'prompt - zsh color pc mode - branch name' '
+test_expect_success 'prompt - zsh color pc mode' '
 	printf "BEFORE: (%%F{green}master%%f%%f):AFTER" >expected &&
 	(
 		ZSH_VERSION=5.0.0 &&
@@ -676,117 +676,4 @@ test_expect_success 'prompt - zsh color pc mode - branch name' '
 	test_cmp expected "$actual"
 '
 
-test_expect_success 'prompt - zsh color pc mode - detached head' '
-	printf "BEFORE: (%%F{red}(%s...)%%f%%f):AFTER" $(git log -1 --format="%h" b1^) >expected &&
-	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
-	(
-		ZSH_VERSION=5.0.0 &&
-		GIT_PS1_SHOWCOLORHINTS=y &&
-		__git_ps1 "BEFORE:" ":AFTER" &&
-		printf "%s" "$PS1" >"$actual"
-	) &&
-	test_cmp expected "$actual"
-'
-
-test_expect_success 'prompt - zsh color pc mode - dirty status indicator - dirty worktree' '
-	printf "BEFORE: (%%F{green}master%%f %%F{red}*%%f):AFTER" >expected &&
-	echo "dirty" >file &&
-	test_when_finished "git reset --hard" &&
-	(
-		ZSH_VERSION=5.0.0 &&
-		GIT_PS1_SHOWDIRTYSTATE=y &&
-		GIT_PS1_SHOWCOLORHINTS=y &&
-		__git_ps1 "BEFORE:" ":AFTER" &&
-		printf "%s" "$PS1" >"$actual"
-	) &&
-	test_cmp expected "$actual"
-'
-
-test_expect_success 'prompt - zsh color pc mode - dirty status indicator - dirty index' '
-	printf "BEFORE: (%%F{green}master%%f %%F{green}+%%f):AFTER" >expected &&
-	echo "dirty" >file &&
-	test_when_finished "git reset --hard" &&
-	git add -u &&
-	(
-		ZSH_VERSION=5.0.0 &&
-		GIT_PS1_SHOWDIRTYSTATE=y &&
-		GIT_PS1_SHOWCOLORHINTS=y &&
-		__git_ps1 "BEFORE:" ":AFTER" &&
-		printf "%s" "$PS1" >"$actual"
-	) &&
-	test_cmp expected "$actual"
-'
-
-test_expect_success 'prompt - zsh color pc mode - dirty status indicator - dirty index and worktree' '
-	printf "BEFORE: (%%F{green}master%%f %%F{red}*%%F{green}+%%f):AFTER" >expected &&
-	echo "dirty index" >file &&
-	test_when_finished "git reset --hard" &&
-	git add -u &&
-	echo "dirty worktree" >file &&
-	(
-		ZSH_VERSION=5.0.0 &&
-		GIT_PS1_SHOWCOLORHINTS=y &&
-		GIT_PS1_SHOWDIRTYSTATE=y &&
-		__git_ps1 "BEFORE:" ":AFTER" &&
-		printf "%s" "$PS1" >"$actual"
-	) &&
-	test_cmp expected "$actual"
-'
-
-test_expect_success 'prompt - zsh color pc mode - dirty status indicator - before root commit' '
-	printf "BEFORE: (%%F{green}master%%f %%F{green}#%%f):AFTER" >expected &&
-	(
-		ZSH_VERSION=5.0.0 &&
-		GIT_PS1_SHOWDIRTYSTATE=y &&
-		GIT_PS1_SHOWCOLORHINTS=y &&
-		cd otherrepo &&
-		__git_ps1 "BEFORE:" ":AFTER" &&
-		printf "%s" "$PS1" >"$actual"
-	) &&
-	test_cmp expected "$actual"
-'
-
-test_expect_success 'prompt - zsh color pc mode - inside .git directory' '
-	printf "BEFORE: (%%F{green}GIT_DIR!%%f%%f):AFTER" >expected &&
-	echo "dirty" >file &&
-	test_when_finished "git reset --hard" &&
-	(
-		ZSH_VERSION=5.0.0 &&
-		GIT_PS1_SHOWDIRTYSTATE=y &&
-		GIT_PS1_SHOWCOLORHINTS=y &&
-		cd .git &&
-		__git_ps1 "BEFORE:" ":AFTER" &&
-		printf "%s" "$PS1" >"$actual"
-	) &&
-	test_cmp expected "$actual"
-'
-
-test_expect_success 'prompt - zsh color pc mode - stash status indicator' '
-	printf "BEFORE: (%%F{green}master%%f %%F{blue}$%%f):AFTER" >expected &&
-	echo 2 >file &&
-	git stash &&
-	test_when_finished "git stash drop" &&
-	(
-		ZSH_VERSION=5.0.0 &&
-		GIT_PS1_SHOWSTASHSTATE=y &&
-		GIT_PS1_SHOWCOLORHINTS=y &&
-		__git_ps1 "BEFORE:" ":AFTER" &&
-		printf "%s" "$PS1" >"$actual"
-	) &&
-	test_cmp expected "$actual"
-'
-
-test_expect_success 'prompt - zsh color pc mode - untracked files status indicator' '
-	printf "BEFORE: (%%F{green}master%%f %%F{red}%%%%%%f):AFTER" >expected &&
-	(
-		ZSH_VERSION=5.0.0 &&
-		GIT_PS1_SHOWUNTRACKEDFILES=y &&
-		GIT_PS1_SHOWCOLORHINTS=y &&
-		__git_ps1 "BEFORE:" ":AFTER" &&
-		printf "%s" "$PS1" >"$actual"
-	) &&
-	test_cmp expected "$actual"
-'
-
 test_done
-- 
1.8.3.1.590.g42a98dd

  parent reply	other threads:[~2013-06-26  3:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26  3:05 [PATCH v2 0/5] git-prompt: cleaning and improvement Eduardo R. D'Avila
2013-06-26  3:05 ` [PATCH v2 1/5] t9903: add tests for git-prompt pcmode Eduardo R. D'Avila
2013-06-26  3:05 ` [PATCH v2 2/5] git-prompt.sh: refactor colored prompt code Eduardo R. D'Avila
2013-06-26  3:05 ` Eduardo R. D'Avila [this message]
2013-06-26  3:05 ` [PATCH v2 4/5] git-prompt.sh: do not print duplicate clean color code Eduardo R. D'Avila
2013-06-26  3:05 ` [PATCH v2 5/5] git-prompt.sh: add missing information in comments Eduardo R. D'Avila
2013-06-27 15:22 ` [PATCH v2 0/5] git-prompt: cleaning and improvement Junio C Hamano
2013-06-28  1:31   ` Eduardo R. D'Avila
2013-06-28  9:42     ` SZEDER Gábor
2013-06-28 17:13       ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=5f56853a746189ccb03b929d472b5a5e721f8fb7.1372211661.git.erdavila@gmail.com \
    --to=erdavila@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=szeder@ira.uka.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).