Re: [PATCH 3/3] rebase -i: Add tests for "--edit-todo"

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

 



Andrew Wong <andrew.kw.w@xxxxxxxxx> writes:

> Signed-off-by: Andrew Wong <andrew.kw.w@xxxxxxxxx>
> ---
>  t/t3404-rebase-interactive.sh | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index 7304b66..a194c97 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -911,4 +911,20 @@ test_expect_success 'rebase -i --root fixup root commit' '
>  	test 0 = $(git cat-file commit HEAD | grep -c ^parent\ )
>  '
>  
> +test_expect_success 'rebase --edit-todo does not works on non-interactive rebase' '
> +	git checkout conflict-branch &&
> +	test_must_fail git rebase --onto HEAD~2 HEAD~ &&
> +	test_must_fail git rebase --edit-todo &&
> +	git rebase --abort
> +'

It _might_ be that you simply inherited sloppiness from surrounding
existing tests, but what happens when a test _before_ this test
failed?  Is "git checkout conflict-branch" sufficient to bring you
to a sensible state where this test would succeed?  I'd prefer to
see a defensive "git reset --hard &&" before the first "checkout".

The same for the next one.

> +test_expect_success 'rebase --edit-todo can be used to modify todo' '
> +	git checkout no-conflict-branch^0 &&
> +	FAKE_LINES="edit 1 2 3" git rebase -i HEAD~3 &&
> +	FAKE_LINES="2 1" git rebase --edit-todo &&
> +	git rebase --continue
> +	test M = $(git cat-file commit HEAD^ | sed -ne \$p) &&
> +	test L = $(git cat-file commit HEAD | sed -ne \$p)
> +'
> +
>  test_done
--
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]