git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [PATCH 2/2] Regression test for "stg assimilate"
Date: Sun, 22 Oct 2006 15:08:08 +0200	[thread overview]
Message-ID: <20061022130807.17015.77803.stgit@localhost> (raw)
In-Reply-To: <20061022130559.17015.51385.stgit@localhost>

From: Karl Hasselström <kha@treskal.com>



Signed-off-by: Karl Hasselström <kha@treskal.com>
---

 t/t1301-assimilate.sh |   86 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/t/t1301-assimilate.sh b/t/t1301-assimilate.sh
new file mode 100755
index 0000000..26b263c
--- /dev/null
+++ b/t/t1301-assimilate.sh
@@ -0,0 +1,86 @@
+#!/bin/sh
+# Copyright (c) 2006 Karl Hasselström
+test_description='Test the assimilate command.'
+. ./test-lib.sh
+
+test_expect_success \
+    'Assimilate in a non-initialized repository' \
+    'stg assimilate'
+
+test_expect_success \
+    'Initialize the StGIT repository' \
+    'stg init'
+
+test_expect_success \
+    'Assimilate in a repository without patches' \
+    'stg assimilate'
+
+test_expect_success \
+    'Create a patch' \
+    '
+    stg new foo -m foo &&
+    echo foo > foo.txt &&
+    stg add foo.txt &&
+    stg refresh
+    '
+
+test_expect_success \
+    'Assimilate when there is nothing to do' \
+    'stg assimilate'
+
+test_expect_success \
+    'Create a GIT commit' \
+    '
+    echo bar > bar.txt &&
+    git add bar.txt &&
+    git commit -a -m bar
+    '
+
+test_expect_success \
+    'Assimilate one GIT commit' \
+    '
+    [ $(stg applied | wc -l) -eq 1 ] &&
+    stg assimilate &&
+    [ $(stg applied | wc -l) -eq 2 ]
+    '
+
+test_expect_success \
+    'Create three more GIT commits' \
+    '
+    echo one > numbers.txt &&
+    git add numbers.txt &&
+    git commit -a -m one &&
+    echo two >> numbers.txt &&
+    git commit -a -m two &&
+    echo three >> numbers.txt &&
+    git commit -a -m three
+    '
+
+test_expect_success \
+    'Assimilate three GIT commits' \
+    '
+    [ $(stg applied | wc -l) -eq 2 ] &&
+    stg assimilate &&
+    [ $(stg applied | wc -l) -eq 5 ]
+    '
+
+test_expect_success \
+    'Create a mege commit' \
+    '
+    git checkout -b br master^^ &&
+    echo woof > woof.txt &&
+    git add woof.txt &&
+    git commit -a -m woof &&
+    git checkout master &&
+    git pull . br
+    '
+
+test_expect_success \
+    'Try (and fail) to assimilate the merge commit' \
+    '
+    [ $(stg applied | wc -l) -eq 5 ] &&
+    ! stg assimilate &&
+    [ $(stg applied | wc -l) -eq 5 ]
+    '
+
+test_done

      parent reply	other threads:[~2006-10-22 13:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-22 13:05 [PATCH 0/2] Resistance is futile; you _will_ be assimilated Karl Hasselström
2006-10-22 13:08 ` [PATCH 1/2] New stg command: assimilate Karl Hasselström
2006-10-22 17:43   ` Petr Baudis
2006-10-22 18:12     ` Karl Hasselström
2006-10-23 11:52       ` Catalin Marinas
2006-10-25 16:32   ` Karl Hasselström
2006-10-25 16:41     ` Catalin Marinas
2006-10-26  8:32       ` Karl Hasselström
2006-10-22 13:08 ` Karl Hasselström [this message]

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=20061022130807.17015.77803.stgit@localhost \
    --to=kha@treskal.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).