Problem writing test

Chris Jerdonek chris.jerdonek at gmail.com
Fri Jan 3 12:22:23 CST 2014


On Fri, Jan 3, 2014 at 5:58 AM, Prasoon Shukla <prasoon92.iitr at gmail.com> wrote:
> Hi
> I was working on issue 4141 and I'm having a hard time writing a test.
>
> The output is like this:
>
> warning! multiple installs of hg detected:
>   /home/prasoon/work/hgwork/hg
>   /usr/bin/hg...
>
> How do I match this output with a regex? Note that there can be any number
> newlines (one for each mercurial install). I tried this using this:
>
> warning! multiple installs of hg detected:[\S\s]*... (re)
>
> but it doesn't seem to be working. So, how can this output be matched?

I believe you would need to modify the code near here to allow
matching across multiple lines in .t files:

http://selenic.com/hg/file/082b2930fe2c/tests/run-tests.py#l629

I believe this is what Matt meant when he recently said, "I'd much
rather you added optional line support in .t output..." in this
e-mail:

http://www.selenic.com/pipermail/mercurial-devel/2013-December/055398.html

Incidentally, checking varying multiple lines (even with specific
strings rather than wildcards) would have been straightforward to do
using the prior version of my patch for issue4128:

http://www.selenic.com/pipermail/mercurial-devel/2013-December/055379.html

However, to avoid the need for any of the above, can't you manually
set the PATH to a known value to trigger that scenario, e.g. using an
idea along the lines of the following?

    $ PATH=`which hg`:`which hg` hg debuginstall

--Chris



>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>


More information about the Mercurial-devel mailing list