git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Palmer <wmpalmer@gmail.com>
To: git@vger.kernel.org
Cc: wmpalmer@gmail.com, gitster@pobox.com
Subject: [PATCH 1/2] add basic tests for merge-tree
Date: Sat, 10 Jul 2010 01:53:50 +0100	[thread overview]
Message-ID: <1278723231-24802-2-git-send-email-wmpalmer@gmail.com> (raw)
In-Reply-To: <1278723231-24802-1-git-send-email-wmpalmer@gmail.com>

merge-tree had no test cases, so here we add some very basic tests for
it, including one known-breakage.

Signed-off-by: Will Palmer <wmpalmer@gmail.com>
---
 t/t4300-merge-tree.sh |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)
 create mode 100755 t/t4300-merge-tree.sh

diff --git a/t/t4300-merge-tree.sh b/t/t4300-merge-tree.sh
new file mode 100755
index 0000000..afcb89d
--- /dev/null
+++ b/t/t4300-merge-tree.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# Copyright (c) 2010 Will Palmer
+#
+
+test_description='git merge-tree'
+. ./test-lib.sh
+
+test_expect_success setup '
+	test_commit "initial"
+'
+
+test_expect_success 'both added same' '
+	git reset --hard initial
+	test_commit "same-A" "ONE" "AAA" 
+
+	git reset --hard initial
+	test_commit "same-B" "ONE" "AAA"
+
+	git merge-tree initial same-A same-B
+'
+
+test_expect_success 'both added conflict' '
+	git reset --hard initial
+	test_commit "diff-A" "ONE" "AAA" 
+
+	git reset --hard initial
+	test_commit "diff-B" "ONE" "BBB"
+
+	git merge-tree initial diff-A diff-B
+'
+
+test_expect_failure 'nothing similar' '
+	git reset --hard initial
+	test_commit "no-common-A" "ONE" "AAA" 
+
+	git reset --hard initial
+	test_commit "no-common-B" "TWO" "BBB"
+
+	git merge-tree initial no-common-A no-common-B
+'
+
+test_done
-- 
1.7.1.703.g42c01

  reply	other threads:[~2010-07-10  0:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-10  0:53 [PATCH 0/2] merge-tree: fix (merge-base a b) b a Will Palmer
2010-07-10  0:53 ` Will Palmer [this message]
2010-07-10  0:53 ` [PATCH 2/2] fix merge-tree where two branches share no changes Will Palmer

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=1278723231-24802-2-git-send-email-wmpalmer@gmail.com \
    --to=wmpalmer@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).