git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Oct 4, 2010, 03:03 UTC
Message-ID
<AANLkTi=B-aJJ1Q3grmea_YWQCgBkaHoYj0Rym4rqY19C@mail.gmail.com>
In-Reply-To
<1286138529-6780-3-git-send-email-ydirson@altern.org>
On Sun, Oct 3, 2010 at 20:42, Yann Dirson <ydirson@altern.org> wrote:
Show 35 quoted lines
> From: Yann Dirson <ydirson@free.fr>
>
> 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))
    '
Show 20 quoted lines
> +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.

Show 9 quoted lines
> +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.
Previous: Yann DirsonNext: Yann Dirson
Message 11 of 25 in “Detection of directory renames”
  1. 0/4 Detection of directory renamesYann Dirson, Oct 3, 2010
  2. 1/4 Introduce wholesame directory move detection in diffcore.Yann Dirson, Oct 3, 2010
  3. 2/4 Add testcases for the --detect-dir-renames diffcore flag.Yann Dirson, Oct 3, 2010
  4. 3/4 Allow hiding renames of individual files involved in a directory rename.Yann Dirson, Oct 3, 2010
  5. 4/4 Add testcases for the --hide-dir-rename-details diffcore flag.Yann Dirson, Oct 3, 2010
  6. Sverre RabbelierOct 3, 2010
  7. Sverre RabbelierOct 3, 2010
  8. Junio C HamanoOct 3, 2010
  9. Sverre RabbelierOct 4, 2010
  10. Yann DirsonOct 4, 2010
  11. Ævar Arnfjörð BjarmasonOct 4, 2010
  12. Yann DirsonOct 4, 2010
  13. Jonathan NiederOct 4, 2010
  14. Yann DirsonOct 4, 2010
  15. Jonathan NiederOct 4, 2010
  16. Andreas EricssonOct 5, 2010
  17. Ævar Arnfjörð BjarmasonOct 4, 2010
  18. Yann DirsonOct 4, 2010
  19. Jonathan NiederOct 4, 2010
  20. Yann DirsonOct 4, 2010
  21. Jonathan NiederOct 5, 2010
  22. Yann DirsonOct 6, 2010
  23. Jonathan NiederOct 4, 2010
  24. Jonathan NiederOct 5, 2010
  25. Yann DirsonOct 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.