git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Kågedal" <david@virtutech.se>
To: "Karl Hasselström" <kha@treskal.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [StGit PATCH] Added test case for stg refresh
Date: Wed, 21 Nov 2007 11:43:00 +0100	[thread overview]
Message-ID: <87oddnvpzf.fsf@virtutech.se> (raw)
In-Reply-To: <87tznfvqb4.fsf@lysator.liu.se> ("David Kågedal"'s message of "Wed\, 21 Nov 2007 11\:35\:59 +0100")

David Kågedal <davidk@lysator.liu.se> writes:

> Signed-off-by: David Kågedal <davidk@lysator.liu.se>
> ---
>
> This test case fails on the kha/experimental branch.  Using "stg
> refresh -p <patch>" can cause all sorts of wieirdness, and there is no
> test case for it.

I just checked, and it fails on kha/safe as well. So maybe there is
some problem with the test case, but I don't know what it is.

And maybe it should be called t2301 instead?

>  t/t2700-refresh.sh |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 65 insertions(+), 0 deletions(-)
>  create mode 100755 t/t2700-refresh.sh
>
> diff --git a/t/t2700-refresh.sh b/t/t2700-refresh.sh
> new file mode 100755
> index 0000000..2e7901c
> --- /dev/null
> +++ b/t/t2700-refresh.sh
> @@ -0,0 +1,65 @@
> +#!/bin/sh
> +
> +test_description='Run "stg refresh"'
> +
> +. ./test-lib.sh
> +
> +test_expect_success 'Initialize StGit stack' '
> +    stg init &&
> +    echo expected.txt >> .git/info/exclude &&
> +    echo patches.txt >> .git/info/exclude &&
> +    stg new p0 -m "base" &&
> +    for i in 1 2 3; do
> +        echo base >> foo$i.txt &&
> +        git add foo$i.txt
> +    done
> +    stg refresh &&
> +    for i in 1 2 3; do
> +        stg new p$i -m "foo $i" &&
> +        echo "foo $i" >> foo$i.txt &&
> +        stg refresh
> +    done
> +'
> +
> +cat > expected.txt <<EOF
> +p0
> +p3
> +EOF
> +test_expect_success 'Refresh top patch' '
> +    echo bar 3 >> foo3.txt &&
> +    stg refresh &&
> +    stg status &&
> +    test -z "$(stg status)" &&
> +    stg patches foo3.txt > patches.txt &&
> +    diff -u expected.txt patches.txt
> +'
> +
> +cat > expected.txt <<EOF
> +p0
> +p2
> +EOF
> +test_expect_success 'Refresh middle patch' '
> +    stg status &&
> +    echo bar 2 >> foo2.txt &&
> +    stg refresh -p p2 &&
> +    stg status &&
> +    test -z "$(stg status)" &&
> +    stg patches foo2.txt > patches.txt &&
> +    diff -u expected.txt patches.txt
> +'
> +
> +cat > expected.txt <<EOF
> +p0
> +p1
> +EOF
> +test_expect_success 'Refresh bottom patch' '
> +    stg status &&
> +    echo bar 1 >> foo1.txt &&
> +    stg refresh -p p1 &&
> +    stg status &&
> +    test -z "$(stg status)" &&
> +    stg patches foo1.txt > patches.txt &&
> +    diff -u expected.txt patches.txt
> +'
> +
> +test_done
> -- 
> 1.5.3.6.740.ge3d12

-- 
David Kågedal, Virtutech

  reply	other threads:[~2007-11-21 11:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21 10:35 [StGit PATCH] Added test case for stg refresh David Kågedal
2007-11-21 10:43 ` David Kågedal [this message]
2007-11-21 23:15   ` Karl Hasselström
2007-11-21 23:31     ` Catalin Marinas
2007-11-21 23:55       ` Karl Hasselström
2007-11-22  7:59       ` David Kågedal
2007-11-22  8:15         ` Catalin Marinas
2007-11-22  8:38           ` David Kågedal

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=87oddnvpzf.fsf@virtutech.se \
    --to=david@virtutech.se \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.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).