From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [StGIT PATCH 1/3] Make patch deletion test more specific
Date: Sun, 13 May 2007 20:27:20 +0200 [thread overview]
Message-ID: <20070513182720.18810.64330.stgit@yoghurt> (raw)
From: Karl Hasselström <kha@treskal.com>
Don't just test the number of applied and unapplied patches; also test
their name and order.
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
t/t1601-delete-many.sh | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/t/t1601-delete-many.sh b/t/t1601-delete-many.sh
index 8648ed1..8eff308 100755
--- a/t/t1601-delete-many.sh
+++ b/t/t1601-delete-many.sh
@@ -10,13 +10,13 @@ test_expect_success \
test_expect_success \
'Create five applied and five unapplied patches' \
'
- stg new foo0 -m foo0 &&
- echo foo0 > foo.txt &&
+ stg new p0 -m p0 &&
+ echo p0 > foo.txt &&
stg add foo.txt &&
stg refresh &&
for i in 1 2 3 4 5 6 7 8 9; do
- stg new foo$i -m foo$i &&
- echo foo$i >> foo.txt &&
+ stg new p$i -m p$i &&
+ echo p$i >> foo.txt &&
stg refresh;
done &&
stg pop -n 5
@@ -25,31 +25,31 @@ test_expect_success \
test_expect_success \
'Delete some patches' \
'
- [ $(stg applied | wc -l) -eq 5 ] &&
- [ $(stg unapplied | wc -l) -eq 5 ] &&
- stg delete foo7 foo6 foo3 foo4 &&
- [ $(stg applied | wc -l) -eq 3 ] &&
- [ $(stg unapplied | wc -l) -eq 3 ]
+ [ "$(echo $(stg applied))" = "p0 p1 p2 p3 p4" ] &&
+ [ "$(echo $(stg unapplied))" = "p5 p6 p7 p8 p9" ] &&
+ stg delete p7 p6 p3 p4 &&
+ [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
+ [ "$(echo $(stg unapplied))" = "p5 p8 p9" ]
'
test_expect_success \
'Delete some more patches, some of which do not exist' \
'
- [ $(stg applied | wc -l) -eq 3 ] &&
- [ $(stg unapplied | wc -l) -eq 3 ] &&
- ! stg delete foo7 foo8 foo2 foo0 &&
- [ $(stg applied | wc -l) -eq 3 ] &&
- [ $(stg unapplied | wc -l) -eq 3 ]
+ [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
+ [ "$(echo $(stg unapplied))" = "p5 p8 p9" ] &&
+ ! stg delete p7 p8 p2 p0 &&
+ [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
+ [ "$(echo $(stg unapplied))" = "p5 p8 p9" ]
'
test_expect_success \
'Delete a range of patches' \
'
- [ $(stg applied | wc -l) -eq 3 ] &&
- [ $(stg unapplied | wc -l) -eq 3 ] &&
- stg delete foo1..foo8 &&
- [ $(stg applied | wc -l) -eq 1 ] &&
- [ $(stg unapplied | wc -l) -eq 1 ]
+ [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
+ [ "$(echo $(stg unapplied))" = "p5 p8 p9" ] &&
+ stg delete p1..p8 &&
+ [ "$(echo $(stg applied))" = "p0" ] &&
+ [ "$(echo $(stg unapplied))" = "p9" ]
'
test_done
next reply other threads:[~2007-05-13 18:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-13 18:27 Karl Hasselström [this message]
2007-05-13 18:27 ` [StGIT PATCH 2/3] Test patch order, not just number of patches Karl Hasselström
2007-05-13 18:27 ` [StGIT PATCH 3/3] Use "stg applied" instead of reading the applied file directly Karl Hasselström
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070513182720.18810.64330.stgit@yoghurt \
--to=kha@treskal.com \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
/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.
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 NNTP newsgroup(s).