You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-dev@jakarta.apache.org by Oleg Sukhodolsky <so...@ppson.spb.ru> on 2003/10/27 21:30:17 UTC
[PATCH] improvement of RETest
Hi,
I've recently found that RETest was wrote as standalone program, not
as automated test. So, it can not be used in build process, because
even if some tests fail, build fails.
Some tests even don't check if they fail and programmer have to read
RETest's output to find out if they fail.
Another reason to change RETest is Bug#3273 (CharacterArrayCharacterIterator
substring function returns incorrect results). Which was not found by
RETest because it only test RE.match(String). So, it seems reasonable
modify the test so it also check RE.match(CharacterIterator, int).
For these reason I changed build.xml so it fails if RETest fails.
And RETest will return non-zero value if tests fail.
Also I modified format of script file (RETest.txt) so that every
successful test description (description for test which should match)
contains not only list of expected parens, but also number of parens.
I did this because of two reasons:
1. such format makes possible to separate reading of test descripetion
and performing this test
2. it's less error prone. Currently if we have several empty strings
it's unclear if these are expected parens or just separators between
two descriptions.
This version of the patch contains one questionable (for me) thing:
in current RETest's implementation we always use trim on string to
match and expected parens. But this means that we can not provide
string which begins or ends with spaces.
My patch do not trim() these string and one test (#204) fails because
of this. I wonder if this testcase is correct or not? (I was unable
find for which bug it was introduced)
So, it would be great to hear any comments about this patch.
And, of course, it will be much more better to see it integrated ;)
Context diffs are attached (as gzip archive).
With best regards, Oleg.
Re: [PATCH] improvement of RETest
Posted by Vadim Gritsenko <va...@verizon.net>.
Oleg Sukhodolsky wrote:
...
>So, it would be great to hear any comments about this patch.
>And, of course, it will be much more better to see it integrated ;)
>
>
Thanks for the patches, and (usual disclaimer ;-) sorry that it took so
long.
I'd applied the patches with some mods:
* I made RETest less chatty when test succeeds. Now it will print only
test number and pattern. But if test fails, it will print all the info
it used to print.
* Once one of the tests fails, do not continue with this test, but
proceed to the next test.
* Test #204 was failing because trim() was removed. I corrected test
definition.
Thanks again,
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-dev-help@jakarta.apache.org