On 03/07/2012 09:16 PM, Alexander Shulgin wrote:
>
>> I would prefer src/interfaces/libpq/test, to keep it close to the code.
>
> Hm, actually that makes more sense and is not unprecedented (I see ecpg
> has it's own 'test' subdir.) Apparently I was under false impression
> that all regression tests are concentrated under $(topdir)/src/test.
>
> I'll post an updated patch shortly (unless someone like to argue to keep
> the tests where they are now.)
And here it is attached (v7.) The test code now lives under libpq/test.
A colleague of mine also pointed out that expanded PGUSER/PGPORT vars
slipped into the expected.out file in the previous version, so that was
not really useful for testing.
The new version addresses the above issue by expanding shell vars in a
separate step. The test lines moved to separate file 'regress.in,'
since we are expanding the variables manually now (no need to use heredoc.)
After moving the test lines to separate file I've noticed that it was
identical to the expected output file. So I've thought it would be nice
to add some failing URIs as well (improves code coverage.) I did that
and one test highlighted a minor bug, which I've also fixed.
For that, I decided to move previously extracted parts of code back to
the main parser routine, as it was getting too ugly to pass all the
required local vars to them. I hope this won't confuse the ones who had
a chance to review previous version too much.
--
Regards,
Alex