git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v3 2/2] Add tests for rev-list --bisect* --first-parent
@ 2018-05-23 12:01 Tiago Botelho
  2018-05-24  2:42 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Tiago Botelho @ 2018-05-23 12:01 UTC (permalink / raw)
  To: git; +Cc: christian.couder, johannes.schindelin, haraldnordgren,
	Tiago Botelho

---
 t/t6002-rev-list-bisect.sh | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/t/t6002-rev-list-bisect.sh b/t/t6002-rev-list-bisect.sh
index a66140803..977c82157 100755
--- a/t/t6002-rev-list-bisect.sh
+++ b/t/t6002-rev-list-bisect.sh
@@ -263,4 +263,43 @@ test_expect_success 'rev-parse --bisect can default to good/bad refs' '
 	test_cmp expect.sorted actual.sorted
 '
 
+# We generate the following commit graph:
+#
+#     A
+#    / \
+#   D   B
+#   |   |
+#   EX  C
+#    \  /
+#     FX
+
+test_expect_success 'setup' '
+  test_commit A &&
+  test_commit B &&
+  test_commit C &&
+  git reset --hard A &&
+  test_commit D &&
+  test_commit EX &&
+  test_merge FX C
+'
+
+test_output_expect_success "--bisect --first-parent" 'git rev-list --bisect --first-parent FX ^A' <<EOF
+$(git rev-parse EX)
+EOF
+
+test_output_expect_success "--bisect-vars --first-parent" 'git rev-list --bisect-vars --first-parent FX ^A' <<EOF
+bisect_rev='$(git rev-parse EX)'
+bisect_nr=1
+bisect_good=0
+bisect_bad=1
+bisect_all=3
+bisect_steps=1
+EOF
+
+test_output_expect_success "--bisect-all --first-parent" 'git rev-list --bisect-all --first-parent FX ^A' <<EOF
+$(git rev-parse D) (dist=1)
+$(git rev-parse EX) (dist=1)
+$(git rev-parse FX) (dist=0)
+EOF
+
 test_done
-- 
2.16.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-24  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-23 12:01 [RFC PATCH v3 2/2] Add tests for rev-list --bisect* --first-parent Tiago Botelho
2018-05-24  2:42 ` Junio C Hamano

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).