aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo R. D'Avila <erdavila@gmail.com>2013-06-26 00:05:15 -0300
committerJunio C Hamano <gitster@pobox.com>2013-06-26 13:03:01 -0700
commitf3bd62d02ff189c42d404f9a0b347499e016cc23 (patch)
treef6de312836daa2064bd071d61d17eca2481dc150
parent7fe9031920be5c98a7e58eea6be34442390392ec (diff)
downloadgit-f3bd62d02ff189c42d404f9a0b347499e016cc23.tar.gz
git-f3bd62d02ff189c42d404f9a0b347499e016cc23.tar.xz
t9903: remove redundant tests
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t9903-bash-prompt.sh115
1 files changed, 1 insertions, 114 deletions
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 6a88778fe..f250dfc55 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