Merging test scripts and output demo

Jesse Glick jesse.glick at oracle.com
Fri Jun 18 09:26:10 CDT 2010


On 06/18/2010 10:10 AM, Martin Geisler wrote:
>>   $ hg pull
>>   pulling from ssh://~\S+~
>>   searching for changes
>>   no changes found
>
> If we let '...' mean .*?, a non-greedy match for anything except a
> newline, then I don't even think we need those delimiters.

Perhaps not; just consider output such as

  pulling from ssh://someone@nowhere.net/ - error: nowhere.net offline!
  searching for changes
  no changes found

which would quietly match

  pulling from ssh://...

possibly obscuring a real regression. However to catch such problems the test author has to construct a suitable regexp, and the additional effectiveness of the test may 
not be worth the extra effort and loss of readability. I agree with mpm that the serendipitous regression detection you get with the expected-output style (as opposed to 
xUnit assert style) can be valuable, but it may be that most of these cases would involve an additional line of output (such as a warning) which ... would never match anyway.



More information about the Mercurial-devel mailing list