[PATCH 1/2] add basic tests for merge-tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]