git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGIT PATCH 1/4] Don't use test_expect_failure when more than one thing could fail

From
Karl Hasselström <kha@treskal.com>
Date
Aug 26, 2007, 20:26 UTC
Message-ID
<20070826202615.15933.76401.stgit@yoghurt>
In-Reply-To
<20070826202309.15933.54183.stgit@yoghurt>

It's much better to use ! for the part that you actually expect to fail; that way, the test will still scream if something _else_ goes wrong.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t2101-pull-policy-pull.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t2101-pull-policy-pull.sh b/t/t2101-pull-policy-pull.sh
index 793491c..14d5adb 100755
--- a/t/t2101-pull-policy-pull.sh
+++ b/t/t2101-pull-policy-pull.sh
@@ -39,11 +39,11 @@ test_expect_success \
 # as rewinding, and thus heads/origin is not moved, but the stack
 # is still correctly rebased
 
-test_expect_failure \
+test_expect_success \
     'Rewind/rewrite upstream commit and pull it from clone, without --merged' \
     '
     (cd upstream && echo b >> file2 && stg refresh) &&
-    (cd clone && stg pull)
+    (cd clone && ! stg pull)
     '
 
 test_expect_success \
Previous: Karl HasselströmNext: Karl Hasselström
Message 2 of 8 in “Miscellaneous fixes”
  1. 0/4 Miscellaneous fixesKarl Hasselström, Aug 26, 2007
  2. 1/4 Don't use test_expect_failure when more than one thing could failKarl Hasselström, Aug 26, 2007
  3. 2/4 Don't write None to the conf fileKarl Hasselström, Aug 26, 2007
  4. 3/4 Replace "git repo-config" with "git config" in help textsKarl Hasselström, Aug 26, 2007
  5. 4/4 Compile regexp just onceKarl Hasselström, Aug 26, 2007
  6. Catalin MarinasAug 29, 2007
  7. Karl HasselströmAug 29, 2007
  8. Catalin MarinasSep 3, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.