Re: [PATCH v4 2/4] Add testcases for the --detect-dir-renames diffcore flag.

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

 



On Sun, Oct 3, 2010 at 20:42, Yann Dirson <ydirson@xxxxxxxxxx> wrote:
> From: Yann Dirson <ydirson@xxxxxxx>
>
> This notably includes a couple of tests for cases known not to be
> working correctly yet.
> ---
> Ât/t4046-diff-rename-factorize.sh | Â326 ++++++++++++++++++++++++++++++++++++++
> Â1 files changed, 326 insertions(+), 0 deletions(-)
> Âcreate mode 100755 t/t4046-diff-rename-factorize.sh
>
> diff --git a/t/t4046-diff-rename-factorize.sh b/t/t4046-diff-rename-factorize.sh
> new file mode 100755
> index 0000000..51b0b0b
> --- /dev/null
> +++ b/t/t4046-diff-rename-factorize.sh
> @@ -0,0 +1,326 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2008,2010 Yann Dirson
> +# Copyright (c) 2005 Junio C Hamano
> +#
> +
> +# TODO - missing tests:
> +# * two dirs or more moving all their files to a single dir
> +# * simultaneous bulkmove and rename
> +# * add a new file under a dir that was moved in the same commit
> +
> +test_description='Test rename factorization in diff engine.
> +
> +'
> +. ./test-lib.sh
> +. "$TEST_DIRECTORY"/diff-lib.sh
> +
> +test_expect_success \
> + Â Â'commit the index.' Â\
> + Â Â'git update-ref HEAD $(echo "original empty commit" | git commit-tree $(git write-tree))'

Since this is a new test it should use the nominal style:

    test_expect_success 'commit the index.' '
        git update-ref HEAD $(echo "original empty commit" | git
commit-tree $(git write-tree))
    '

> +mkdir a
> +echo >a/path0 'Line 1
> +Line 2
> +Line 3
> +Line 4
> +Line 5
> +Line 6
> +Line 7
> +Line 8
> +Line 9
> +Line 10
> +line 11
> +Line 12
> +Line 13
> +Line 14
> +Line 15
> +'
> +sed <a/path0 >a/path1 s/Line/Record/
> +sed <a/path0 >a/path2 s/Line/Stuff/
> +sed <a/path0 >a/path3 s/Line/Blurb/

Should be in a test, see "Put all code inside test_expect_success and
other assertions." in t/README.

> +test_expect_success \
> + Â Â'update-index --add file inside a directory.' \
> + Â Â'git update-index --add a/path*'
> +
> +test_expect_success \
> + Â Â'commit the index.' Â\
> + Â Â'git update-ref HEAD $(echo "original set of files" | git commit-tree $(git write-tree))'
> +
> +mv a b

likewise here, and throughout the test of the test.
--
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]