Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] Tests: read-tree -m test updates.
Date: Wed, 08 Jun 2005 02:08:54 -0700	[thread overview]
Message-ID: <7vwtp5b4gp.fsf_-_@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7v7jh5ct1b.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Tue, 07 Jun 2005 22:32:48 -0700")

This updates t1000 (basic 3-way merge test) to check the merge
results for both successful cases (earlier one checked the
result for only one of them).  Also fixes typos in t1002 that
broke '&&' chain, potentially missing a test failure before the
chain got broken.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 t/t1000-read-tree-m-3way.sh   |   58 ++++++++++++++++++++---------------------
 t/t1002-read-tree-m-u-2way.sh |    4 +--
 2 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh
--- a/t/t1000-read-tree-m-3way.sh
+++ b/t/t1000-read-tree-m-3way.sh
@@ -77,34 +77,6 @@ In addition:
 ################################################################
 # Try merging and showing the various diffs
 
-# The tree is dirty at this point.
-test_expect_failure \
-    '3-way merge with git-read-tree -m' \
-    "git-read-tree -m $tree_O $tree_A $tree_B"
-
-# This is done on an empty work directory, which is the normal
-# merge person behaviour.
-test_expect_success \
-    '3-way merge with git-read-tree -m' \
-    "rm -fr [NDMALTS][NDMALTSF] Z &&
-     rm .git/index &&
-     git-read-tree -m $tree_O $tree_A $tree_B"
-
-# This starts out with the first head, which is the normal
-# patch submitter behaviour.
-test_expect_success \
-    '3-way merge with git-read-tree -m' \
-    "git-read-tree $tree_A &&
-     git-checkout-cache -f -u -a &&
-     git-read-tree -m $tree_O $tree_A $tree_B"
-
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
-test_expect_success \
-    'git-ls-files --stage of the merge result' \
-    'git-ls-files --stage >current- &&
-     sed -e "s/ $_x40 / X /" <current- >current'
-
 cat >expected <<\EOF
 100644 X 2	AA
 100644 X 3	AA
@@ -154,8 +126,34 @@ cat >expected <<\EOF
 100644 X 0	Z/NN
 EOF
 
+_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
+_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
+
+# The tree is dirty at this point.
+test_expect_failure \
+    '3-way merge with git-read-tree -m, dirty cache' \
+    "git-read-tree -m $tree_O $tree_A $tree_B"
+
+# This is done on an empty work directory, which is the normal
+# merge person behaviour.
+test_expect_success \
+    '3-way merge with git-read-tree -m, empty cache' \
+    "rm -fr [NDMALTS][NDMALTSF] Z &&
+     rm .git/index &&
+     git-read-tree -m $tree_O $tree_A $tree_B &&
+     git-ls-files --stage |
+     sed -e 's/ $_x40 / X /' >current &&
+     diff -u expected current"
+
+# This starts out with the first head, which is the normal
+# patch submitter behaviour.
 test_expect_success \
-    'validate merge result' \
-    'diff current expected'
+    '3-way merge with git-read-tree -m, match H' \
+    "git-read-tree $tree_A &&
+     git-checkout-cache -f -u -a &&
+     git-read-tree -m $tree_O $tree_A $tree_B &&
+     git-ls-files --stage |
+     sed -e 's/ $_x40 / X /' >current &&
+     diff -u expected current"
 
 test_done
diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -93,7 +93,7 @@ test_expect_success \
      compare_change 5diff.out expected &&
      check_cache_at yomin dirty &&
      sha1sum -c M.sha1 &&
-     : dirty index should have prevented -u from checking it out.
+     : dirty index should have prevented -u from checking it out. &&
      echo yomin yomin >yomin1 &&
      diff yomin yomin1 &&
      rm -f yomin1'
@@ -122,7 +122,7 @@ test_expect_success \
      diff --unified=0 M.out 7.out &&
      check_cache_at frotz dirty &&
      if sha1sum -c M.sha1; then false; else :; fi &&
-     : dirty index should have prevented -u from checking it out.
+     : dirty index should have prevented -u from checking it out. &&
      echo frotz frotz >frotz1 &&
      diff frotz frotz1 &&
      rm -f frotz1'
------------


  reply	other threads:[~2005-06-08  9:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-05 21:39 [PATCH] Documentation: describe git extended diff headers Junio C Hamano
2005-06-05 22:11 ` Linus Torvalds
2005-06-05 22:25   ` [PATCH] Fix diff.c to match rename extended header to the document Junio C Hamano
2005-06-05 22:27   ` [PATCH] Fix apply.c " Junio C Hamano
2005-06-05 22:33     ` Linus Torvalds
2005-06-05 23:21   ` Last mile for 1.0 Junio C Hamano
2005-06-05 23:45     ` Junio C Hamano
2005-06-06 13:29       ` McMullan, Jason
2005-06-06  0:02     ` Linus Torvalds
2005-06-06  0:46       ` [PATCH] git-whatchanged vs "cvs annotate" Junio C Hamano
2005-06-06  5:43       ` Last mile for 1.0 Thomas Glanzmann
2005-06-06  6:13         ` Linus Torvalds
2005-06-06  6:35           ` Junio C Hamano
2005-06-06  6:44             ` Linus Torvalds
2005-06-06  6:44           ` Thomas Glanzmann
2005-06-06  6:57             ` Linus Torvalds
2005-06-06  7:01               ` Thomas Glanzmann
2005-06-06  7:05               ` Junio C Hamano
2005-06-06 14:37                 ` Linus Torvalds
     [not found]                   ` <7vy89ns354.fsf_-_@assigned-by-dhcp.cox.net>
     [not found]                     ` <Pine.LNX.4.58.0506061312520.1876@ppc970.osdl.org>
     [not found]                       ` <Pine.LNX.4.58.0506061403170.1876@ppc970.osdl.org>
     [not found]                         ` <7vekbfnot9.fsf@assigned-by-dhcp.cox.net>
     [not found]                           ` <Pine.LNX.4.58.0506061453400.1876@ppc970.osdl.org>
     [not found]                             ` <7vy89mlmsv.fsf_-_@assigned-by-dhcp.cox.net>
     [not found]                               ` <7vis0qk2jo.fsf_-_@assigned-by-dhcp.cox.net>
     [not found]                                 ` <Pine.LNX.4.58.0506070808180.2286@ppc970.osdl.org>
2005-06-08  3:53                                   ` 3-way read-tree case matrix Junio C Hamano
2005-06-08  5:32                                     ` Junio C Hamano
2005-06-08  9:08                                       ` Junio C Hamano [this message]
2005-06-06  6:45           ` Last mile for 1.0 Junio C Hamano
2005-06-06  7:03             ` Linus Torvalds
     [not found]               ` <7vacm4ufnl.fsf@assigned-by-dhcp.cox.net>
2005-06-06 14:47                 ` Linus Torvalds

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=7vwtp5b4gp.fsf_-_@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.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