Code

Sane use of test_expect_failure
[git.git] / t / t6006-rev-list-format.sh
index aab17face8c0b326359c250bb83684ed3b894160..0dc915ea67b21d07d8e4dca44767906e05ad2278 100755 (executable)
@@ -1,12 +1,12 @@
 #!/bin/sh
 
-test_description='git-rev-list --pretty=format test'
+test_description='git rev-list --pretty=format test'
 
 . ./test-lib.sh
 
 test_tick
 test_expect_success 'setup' '
-touch foo && git-add foo && git-commit -m "added foo" &&
+touch foo && git add foo && git-commit -m "added foo" &&
   echo changed >foo && git-commit -a -m "changed foo"
 '
 
@@ -14,8 +14,8 @@ touch foo && git-add foo && git-commit -m "added foo" &&
 test_format() {
        cat >expect.$1
        test_expect_success "format $1" "
-git-rev-list --pretty=format:$2 master >output.$1 &&
-git-diff expect.$1 output.$1
+git rev-list --pretty=format:$2 master >output.$1 &&
+git diff expect.$1 output.$1
 "
 }
 
@@ -79,9 +79,7 @@ EOF
 
 test_format encoding %e <<'EOF'
 commit 131a310eb913d107dd3c09a65d1651175898735d
-<unknown>
 commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873
-<unknown>
 EOF
 
 test_format subject %s <<'EOF'
@@ -93,9 +91,7 @@ EOF
 
 test_format body %b <<'EOF'
 commit 131a310eb913d107dd3c09a65d1651175898735d
-<unknown>
 commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873
-<unknown>
 EOF
 
 test_format colors %Credfoo%Cgreenbar%Cbluebaz%Cresetxyzzy <<'EOF'
@@ -113,7 +109,7 @@ and it will be encoded in iso8859-1. We should therefore
 include an iso8859 character: ¡bueno!
 EOF
 test_expect_success 'setup complex body' '
-git-config i18n.commitencoding iso8859-1 &&
+git config i18n.commitencoding iso8859-1 &&
   echo change2 >foo && git-commit -a -F commit-msg
 '
 
@@ -121,9 +117,7 @@ test_format complex-encoding %e <<'EOF'
 commit f58db70b055c5718631e5c61528b28b12090cdea
 iso8859-1
 commit 131a310eb913d107dd3c09a65d1651175898735d
-<unknown>
 commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873
-<unknown>
 EOF
 
 test_format complex-subject %s <<'EOF'
@@ -142,9 +136,17 @@ and it will be encoded in iso8859-1. We should therefore
 include an iso8859 character: ¡bueno!
 
 commit 131a310eb913d107dd3c09a65d1651175898735d
-<unknown>
 commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873
-<unknown>
 EOF
 
+test_expect_success 'empty email' '
+       test_tick &&
+       C=$(GIT_AUTHOR_EMAIL= git commit-tree HEAD^{tree} </dev/null) &&
+       A=$(git show --pretty=format:%an,%ae,%ad%n -s $C) &&
+       test "$A" = "A U Thor,,Thu Apr 7 15:14:13 2005 -0700" || {
+               echo "Eh? $A" >failure
+               false
+       }
+'
+
 test_done