login
Header Space

 
 

[StGIT PATCH 2/5] Have only a single command in each test_expect_failure

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Catalin Marinas <catalin.marinas@...>
Cc: <git@...>
Date: Friday, May 18, 2007 - 8:09 pm

Otherwise, we can't know which one failed.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---

 t/t1000-branch-create.sh |   71 ++++++++++++++++++++++++++++------------------
 1 files changed, 43 insertions(+), 28 deletions(-)

diff --git a/t/t1000-branch-create.sh b/t/t1000-branch-create.sh
index 58209e7..cca5504 100755
--- a/t/t1000-branch-create.sh
+++ b/t/t1000-branch-create.sh
@@ -12,57 +12,72 @@ Exercises the "stg branch" commands.
 
 stg init
 
+test_expect_success \
+    'Create a spurious refs/patches/ entry' '
+    find .git -name foo | xargs rm -rf &&
+    touch .git/refs/patches/foo
+'
+
 test_expect_failure \
-    'Try to create an stgit branch with a spurious refs/patches/ entry' \
-    'find .git -name foo | xargs rm -rf &&
-     touch .git/refs/patches/foo &&
-     stg branch -c foo
+    'Try to create an stgit branch with a spurious refs/patches/ entry' '
+    stg branch -c foo
+'
+
+test_expect_success \
+    'Check that no part of the branch was created' '
+    test "`find .git -name foo | tee /dev/stderr`" = ".git/refs/patches/foo" &&
+    ( grep foo .git/HEAD; test $? = 1 )
 '
 
 test_expect_success \
-    'Check no part of the branch was created' \
-    'test "`find .git -name foo | tee /dev/stderr`" = ".git/refs/patches/foo" &&
-     ( grep foo .git/HEAD; test $? = 1 )
+    'Create a spurious patches/ entry' '
+    find .git -name foo | xargs rm -rf &&
+    touch .git/patches/foo
 '
 
 test_expect_failure \
-    'Try to create an stgit branch with a spurious patches/ entry' \
-    'find .git -name foo | xargs rm -rf &&
-     touch .git/patches/foo &&
-     stg branch -c foo
+    'Try to create an stgit branch with a spurious patches/ entry' '
+    stg branch -c foo
 '
 
 test_expect_success \
-    'Check no part of the branch was created' \
-    'test "`find .git -name foo | tee /dev/stderr`" = ".git/patches/foo" &&
-     ( grep foo .git/HEAD; test $? = 1 )
+    'Check that no part of the branch was created' '
+    test "`find .git -name foo | tee /dev/stderr`" = ".git/patches/foo" &&
+    ( grep foo .git/HEAD; test $? = 1 )
+'
+
+test_expect_success \
+    'Create a git branch' '
+    find .git -name foo | xargs rm -rf &&
+    cp .git/refs/heads/master .git/refs/heads/foo
 '
 
 test_expect_failure \
-    'Try to create an stgit branch with an existing git branch by that name' \
-    'find .git -name foo | xargs rm -rf &&
-     cp .git/refs/heads/master .git/refs/heads/foo &&
-     stg branch -c foo
+    'Try to create an stgit branch with an existing git branch by that name' '
+    stg branch -c foo
 '
 
 test_expect_success \
-    'Check no part of the branch was created' \
-    'test "`find .git -name foo | tee /dev/stderr`" = ".git/refs/heads/foo" &&
-     ( grep foo .git/HEAD; test $? = 1 )
+    'Check that no part of the branch was created' '
+    test "`find .git -name foo | tee /dev/stderr`" = ".git/refs/heads/foo" &&
+    ( grep foo .git/HEAD; test $? = 1 )
 '
 
+test_expect_success \
+    'Create an invalid refs/heads/ entry' '
+    find .git -name foo | xargs rm -rf &&
+    touch .git/refs/heads/foo
+'
 
 test_expect_failure \
-    'Try to create an stgit branch with an invalid refs/heads/ entry' \
-    'find .git -name foo | xargs rm -rf &&
-     touch .git/refs/heads/foo &&
-     stg branch -c foo
+    'Try to create an stgit branch with an invalid refs/heads/ entry' '
+    stg branch -c foo
 '
 
 test_expect_success \
-    'Check no part of the branch was created' \
-    'test "`find .git -name foo | tee /dev/stderr`" = ".git/refs/heads/foo" &&
-     ( grep foo .git/HEAD; test $? = 1 )
+    'Check that no part of the branch was created' '
+    test "`find .git -name foo | tee /dev/stderr`" = ".git/refs/heads/foo" &&
+    ( grep foo .git/HEAD; test $? = 1 )
 '
 
 test_done

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[StGit PATCH 0/2] Bash prompt updates, Robin Rosenberg, (Sun May 20, 4:03 pm)
Re: [StGIT PATCH] Don't use patches/&lt;branch&gt;/current, Catalin Marinas, (Tue May 15, 11:56 am)
Re: [StGIT PATCH] Don't use patches/&lt;branch&gt;/current, Catalin Marinas, (Tue May 15, 5:36 pm)
[StGIT PATCH 0/5] Metadata format versioning, Karl , (Fri May 18, 8:09 pm)
[StGIT PATCH 2/5] Have only a single command in each test_ex..., Karl , (Fri May 18, 8:09 pm)
Re: [StGIT PATCH] Don't use patches/&lt;branch&gt;/current, Catalin Marinas, (Tue May 15, 4:01 pm)
Re: [StGIT PATCH] Don't use patches/&lt;branch&gt;/current, Catalin Marinas, (Wed May 16, 8:07 am)
Re: [StGIT PATCH] Don't use patches/&lt;branch&gt;/current, Catalin Marinas, (Thu May 17, 8:43 am)
Re: [StGIT PATCH] Don't use patches/&lt;branch&gt;/current, Catalin Marinas, (Thu May 17, 4:51 pm)
Re: [StGIT PATCH] Don't use patches/&lt;branch&gt;/current, Peter Oberndorfer, (Tue May 15, 12:21 pm)
Re: [StGIT PATCH] Don't use patches/&lt;branch&gt;/current, Catalin Marinas, (Tue May 15, 12:50 pm)
speck-geostationary