From: Stephen Boyd <bebarino@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 3/7] t6200: test fmt-merge-msg more
Date: Wed, 24 Mar 2010 00:16:00 -0700 [thread overview]
Message-ID: <1269414964-9518-4-git-send-email-bebarino@gmail.com> (raw)
In-Reply-To: <1269414964-9518-1-git-send-email-bebarino@gmail.com>
Add some more tests so we don't break behavior upon modernizing
fmt-merge-msg.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
t/t6200-fmt-merge-msg.sh | 115 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 115 insertions(+), 0 deletions(-)
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index b24c5bf..42f8ece 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -62,6 +62,14 @@ test_expect_success setup '
test_tick &&
git commit -a -m "Right #5" &&
+ git checkout -b long &&
+ i=0 &&
+ while test $i -lt 30
+ do
+ test_commit $i one &&
+ i=$(($i+1))
+ done &&
+
git show-branch
'
@@ -253,4 +261,111 @@ test_expect_success 'merge-msg with nothing to merge' '
test_cmp /dev/null actual
'
+cat >expected <<\EOF
+Merge tag 'tag-r3'
+
+* tag 'tag-r3':
+ Right #3
+ Common #2
+ Common #1
+EOF
+
+test_expect_success 'merge-msg tag' '
+
+ git config --unset-all merge.log
+ git config --unset-all merge.summary
+ git config merge.summary yes &&
+
+ git checkout master &&
+ test_tick &&
+ git fetch . tag tag-r3 &&
+
+ git fmt-merge-msg <.git/FETCH_HEAD >actual &&
+ test_cmp expected actual
+'
+
+cat >expected <<\EOF
+Merge tags 'tag-r3' and 'tag-l5'
+
+* tag 'tag-r3':
+ Right #3
+ Common #2
+ Common #1
+
+* tag 'tag-l5':
+ Left #5
+ Left #4
+ Left #3
+ Common #2
+ Common #1
+EOF
+
+test_expect_success 'merge-msg two tags' '
+
+ git config --unset-all merge.log
+ git config --unset-all merge.summary
+ git config merge.summary yes &&
+
+ git checkout master &&
+ test_tick &&
+ git fetch . tag tag-r3 tag tag-l5 &&
+
+ git fmt-merge-msg <.git/FETCH_HEAD >actual &&
+ test_cmp expected actual
+'
+
+cat >expected <<\EOF
+Merge branch 'left', tag 'tag-r3'
+
+* tag 'tag-r3':
+ Right #3
+ Common #2
+ Common #1
+
+* left:
+ Left #5
+ Left #4
+ Left #3
+ Common #2
+ Common #1
+EOF
+
+test_expect_success 'merge-msg tag and branch' '
+
+ git config --unset-all merge.log
+ git config --unset-all merge.summary
+ git config merge.summary yes &&
+
+ git checkout master &&
+ test_tick &&
+ git fetch . tag tag-r3 left &&
+
+ git fmt-merge-msg <.git/FETCH_HEAD >actual &&
+ test_cmp expected actual
+'
+
+cat >expected <<\EOF
+Merge branch 'long'
+
+* long: (35 commits)
+EOF
+
+test_expect_success 'merge-msg lots of commits' '
+
+ git checkout master &&
+ test_tick &&
+ git fetch . long &&
+
+ i=29 &&
+ while test $i -gt 9
+ do
+ echo " $i" &&
+ i=$(($i-1))
+ done >>expected &&
+ echo " ..." >>expected
+
+ git fmt-merge-msg <.git/FETCH_HEAD >actual &&
+ test_cmp expected actual
+'
+
test_done
--
1.7.0.3.254.g4503b
next prev parent reply other threads:[~2010-03-24 7:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 7:15 [PATCH 0/7] fmt-merge-msg improvements Stephen Boyd
2010-03-24 7:15 ` [PATCH 1/7] fmt-merge-msg: be quiet if nothing to merge Stephen Boyd
2010-03-25 2:39 ` Junio C Hamano
2010-03-25 3:48 ` Stephen Boyd
2010-03-24 7:15 ` [PATCH 2/7] t6200: modernize with test_tick Stephen Boyd
2010-03-24 7:16 ` Stephen Boyd [this message]
2010-03-24 7:16 ` [PATCH 4/7] fmt-merge-msg: use pretty.c routines Stephen Boyd
2010-03-24 7:16 ` [PATCH 5/7] string-list: add unsorted_string_list_lookup() Stephen Boyd
2010-03-24 7:16 ` [PATCH 6/7] fmt-merge-msg: remove custom string_list implementation Stephen Boyd
2010-03-30 5:18 ` Junio C Hamano
2010-04-01 6:08 ` Stephen Boyd
2010-04-01 6:29 ` [PATCH 8/7] Make string_list_append() consistent with everything else Stephen Boyd
2010-04-01 20:07 ` Julian Phillips
2010-03-24 7:16 ` [PATCH 7/7] fmt-merge-msg: hide summary option Stephen Boyd
2010-03-25 2:45 ` Junio C Hamano
2010-03-25 5:19 ` Stephen Boyd
2010-03-26 19:30 ` Junio C Hamano
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=1269414964-9518-4-git-send-email-bebarino@gmail.com \
--to=bebarino@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).