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

Re: [PATCH 4/5] t6022, t6046: test expected behavior instead of testing a proxy for it

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Mar 13, 2020, 17:30 UTC
Message-ID
<20200313173016.GG3122@szeder.dev>
In-Reply-To
<CABPp-BGt4xaqG+3m3q=PfMTmfotjvze2TPp5JhthE2YHsLa=-Q@mail.gmail.com>
On Fri, Mar 13, 2020 at 10:18:29AM -0700, Elijah Newren wrote:
Show 48 quoted lines
> On Fri, Mar 13, 2020 at 10:12 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
> >
> > On Thu, Feb 27, 2020 at 12:14:23AM +0000, Elijah Newren via GitGitGadget wrote:
> > > diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh
> > > index 6f196aaf276..d97cf48495b 100755
> > > --- a/t/t6022-merge-rename.sh
> > > +++ b/t/t6022-merge-rename.sh
> > > @@ -242,12 +242,23 @@ test_expect_success 'merge of identical changes in a renamed file' '
> > >       rm -f A M N &&
> > >       git reset --hard &&
> > >       git checkout change+rename &&
> > > +
> > > +     test-tool chmtime =31337 B &&
> > > +     test-tool chmtime --get B >old-mtime &&
> >
> > Here you compare the mtime of 'B' before ...
> >
> > >       GIT_MERGE_VERBOSITY=3 git merge change >out &&
> > > -     test_i18ngrep "^Skipped B" out &&
> > > +
> > > +     test-tool chmtime --get B >new-mtime &&
> > > +     test_cmp old-mtime new-mtime &&
> >
> > ... and after the merge.
> >
> > > +
> > >       git reset --hard HEAD^ &&
> > >       git checkout change &&
> > > +
> > > +     test-tool chmtime =-1 M &&
> > > +     test-tool chmtime --get M >old-mtime &&
> >
> > Here, however, you compare the mtime of 'M' before the merge ...
> >
> > >       GIT_MERGE_VERBOSITY=3 git merge change+rename >out &&
> > > -     test_i18ngrep ! "^Skipped B" out
> > > +
> > > +     test-tool chmtime --get B >new-mtime &&
> > > +     test $(cat old-mtime) -lt $(cat new-mtime)
> >
> > ... with the mtime of 'B' after the merge, i.e. the mtimes of two
> > different files.
> >
> > Is that right?
> 
> No, sounds like a copy-and-paste-and-forget-to-update bug.  Thanks for
> spotting it.  Since you found it, do you want to submit a patch with
> the fix?

No :) There is no file 'B' in branch 'change', so I think the fix requires your expertise to make sure that the test checks what it was supposed to check.

Previous: Elijah NewrenNext: Elijah Newren
Message 15 of 16 in “Testcase cleanups (merge related)”
  1. 0/5 Testcase cleanups (merge related)Elijah Newren via GitGitGadget, Feb 27, 2020
  2. 3/5 t3035: prefer test_must_fail to bash negation for git commandsElijah Newren via GitGitGadget, Feb 27, 2020
  3. 2/5 t6020, t6022, t6035: update merge tests to use test helper functionsElijah Newren via GitGitGadget, Feb 27, 2020
  4. 5/5 t6020: new test with interleaved lexicographic ordering of directoriesElijah Newren via GitGitGadget, Feb 27, 2020
  5. 1/5 t602[1236], t6034: modernize test formattingElijah Newren via GitGitGadget, Feb 27, 2020
  6. 4/5 t6022, t6046: test expected behavior instead of testing a proxy for itElijah Newren via GitGitGadget, Feb 27, 2020
  7. SZEDER GáborMar 12, 2020
  8. Elijah NewrenMar 12, 2020
  9. Elijah NewrenMar 12, 2020
  10. SZEDER GáborMar 12, 2020
  11. SZEDER GáborMar 13, 2020
  12. Elijah NewrenMar 13, 2020
  13. SZEDER GáborMar 13, 2020
  14. Elijah NewrenMar 13, 2020
  15. SZEDER GáborMar 13, 2020
  16. Elijah NewrenMar 13, 2020

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.