From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
Cc: | Robins Tharakan <tharakan(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Add regression tests for ROLE (USER) |
Date: | 2013-07-15 16:34:26 |
Message-ID: | CA+Tgmoa6uTir+-kBFfm2z2mguKq0pp7TEkL+s7=DR034x3N6cA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Jul 15, 2013 at 11:48 AM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
>> I simply don't understand how we can be getting any meaningful test
>> coverage out of those cases. I mean, if we want to check every bit of
>> syntax that could lead to a syntax error, we could probably come up
>> with a near-infinite number of test cases:
>
> I think that it would be enough to check for expected
> keywords/identifier/stuff whether the syntax error reported make sense.
> Basically the parser reports the first found inconsistency.
>
> 1. CREAT TABLE foo (x int);
> 2. CREATE TABL foo (x int);
> 3. CREATER TABLE foo (x int); -- same as 1
> 4. CREATE TABLES foo (x int); -- same as 2
> 5. CREATE CREATE TABLE foo (x int); -- hmmm.
> 6. CREATE TABLE foo [x int);
> 7. CREATE TABLE foo (x int];
> 8. CREATE TABLE foo [x int]; -- same as 6 & 7
> 9. CREATE TABLE (x int);
> A. CREATE foo (x int); -- same as 2
>
> This level of testing can be more or less linear in the number of token.
Maybe so, but that's still a huge number of regression tests that in
practice won't find anything. But they will take work to maintain.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2013-07-15 16:50:40 | Re: ALTER TABLE lock strength reduction patch is unsafe |
Previous Message | Robert Haas | 2013-07-15 16:32:09 | Re: Add tests for LOCK TABLE |