jakarta-regexp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Sukhodolsky <...@ppson.spb.ru>
Subject [PATCH] improvement of RETest
Date Mon, 27 Oct 2003 20:30:17 GMT

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.
View raw message