[PATCH STABLE] test: add test for the issue introduced by e410be860393 (issue3669)
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Mon Oct 22 01:21:43 CDT 2012
At Sun, 21 Oct 2012 17:22:50 -0500,
Matt Mackall wrote:
>
> On Sun, 2012-10-21 at 23:56 +0900, FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> > # Date 1350831165 -32400
> > # Branch stable
> > # Node ID ca94ae8b7660f0bd73354834ce17144f29c63f00
> > # Parent b32e55e6c3c729c1eb0658a0c3bc109259bfdae6
> > test: add test for the issue introduced by e410be860393 (issue3669)
> >
> > e410be860393 (released as Mercurial 2.3) introduced the issue that the
> > revset program started with 40 hexadecimal letters caused unexpected
> > result at "hg log" execution.
> >
> > This issue was already fixed by bde1185f406c (released as 2.3.1), but
> > there is no test to examine whether this issue is certainly fixed or
> > not: no test fails even if bde1185f406c is backed out.
> >
> > This patch adds test for this issue.
> >
> > Added test is confirmed to fail, when it is tested against:
> >
> > - Mercurial 2.3, or
> > - Mercurial 2.3.1 or later with backing bde1185f406c out
> >
> > diff -r b32e55e6c3c7 -r ca94ae8b7660 tests/test-revset.t
> > --- a/tests/test-revset.t Fri Oct 19 14:47:55 2012 -0500
> > +++ b/tests/test-revset.t Sun Oct 21 23:52:45 2012 +0900
> > @@ -825,3 +825,38 @@
> > 3
> >
> > $ cd ..
> > +
> > +issue3669: test revsets started with 40 hexadecimal letters
> > +
> > + $ hg init issue3669
> > + $ cd issue3669
> > +
> > + $ echo a > a
> > + $ hg add a
> > + $ hg commit -m '#0'
> > + $ echo 1 >> a
> > + $ hg commit -m '#1'
>
> Please, do not do this, tests are not free. There's already a dozen
> perfectly good commits built by this test. Quote:
>
> The test suite is slow. And the test suite is slow because it is
> highly redundant. And it is highly redundant because for years
> we've been writing a completely new test for each issue that
> creates a new repo, adds a file, runs status, commits, does a
> merge, etc.
>
> http://mercurial.selenic.com/wiki/WritingTests#No_more_new_test_scripts.21
>
> Do this instead:
>
> --- a/tests/test-revset.t Sat Oct 20 21:43:46 2012 -0400
> +++ b/tests/test-revset.t Sun Oct 21 17:12:57 2012 -0500
> @@ -96,6 +96,17 @@
> $ echo "[paths]" >> .hg/hgrc
> $ echo "default = ../remote1" >> .hg/hgrc
>
> +test 40-char hashes in revset:
> +
> + $ hg log -r "24286f4ae13518d6b14fddd52e78f20be2155a9a^"
> + changeset: 9:24286f4ae135
> + branch: \xc3\xa9 (esc)
> + tag: tip
> + user: test
> + date: Thu Jan 01 00:00:00 1970 +0000
> + summary: Added tag 1.0 for changeset e0cc66ef77e8
> +
> +
>
> (queued)
Thank you for your comments, and sorry for my adding redundant/useless
repo-creation/commits.
> And that's absolutely all the testing that's warranted for this issue.
> There's only one hash to revision facility, deep beneath revsets.
> Testing with a bunch of different revsets won't test any new paths.
OK, I'll post simplified tests, soon.
----------------------------------------------------------------------
[FUJIWARA Katsunori] foozy at lares.dti.ne.jp
More information about the Mercurial-devel
mailing list