Re: [HACKERS] [PROPOSAL] TAP test example

2015-11-19 Thread Tom Lane
Jim Nasby writes: > On 11/19/15 9:57 AM, Tom Lane wrote: >> Agreed. We aren't going to accept any core tests that depend on DBI/DBD. >> Now, that might be a fine example for tests written to test something that >> uses Postgres ... but not as an example of how to write

Re: [HACKERS] [PROPOSAL] TAP test example

2015-11-19 Thread Nikolay Shaplov
В письме от 19 ноября 2015 10:57:27 пользователь Tom Lane написал: > Nikolay Shaplov writes: > > But this is not the issue. We can change it any way we like. The question > > do we need such example at all, or no? > > I'm kind of -1 on the idea of a module that doesn't

Re: [HACKERS] [PROPOSAL] TAP test example

2015-11-19 Thread Jim Nasby
On 11/19/15 8:42 AM, Nikolay Shaplov wrote: +sub psql_ok +{ + my $db = shift; + my $sql = shift; + my $comment = shift; Isn't the preferred method of parameter assignment to use @_? Also, I'd think one of the examples should use DBI, since presumably one of the big benefits

Re: [HACKERS] [PROPOSAL] TAP test example

2015-11-19 Thread Nikolay Shaplov
В письме от 19 ноября 2015 09:39:41 пользователь Jim Nasby написал: > On 11/19/15 8:42 AM, Nikolay Shaplov wrote: > > +sub psql_ok > > +{ > > + my $db = shift; > > + my $sql = shift; > > + my $comment = shift; > > Isn't the preferred method of parameter assignment to use @_? Hm... it is the

Re: [HACKERS] [PROPOSAL] TAP test example

2015-11-19 Thread Tom Lane
Nikolay Shaplov writes: > But this is not the issue. We can change it any way we like. The question do > we need such example at all, or no? I'm kind of -1 on the idea of a module that doesn't actually do something *useful*. Let's write some actual tests instead, and

Re: [HACKERS] [PROPOSAL] TAP test example

2015-11-19 Thread Jim Nasby
On 11/19/15 9:57 AM, Tom Lane wrote: >I wrote this example based on ssl TAP test. There was no DBI there. And I >think it was done for purpose. If we add DBI to tests, then we should add it >to build dependencies. And it is not a good idea, and so not a good example. Agreed. We aren't going to

[HACKERS] [PROPOSAL] TAP test example

2015-11-19 Thread Nikolay Shaplov
Don't we need a simple example of TAP tests in src/test ? Something that test a trivial feature, but shows basic testing tricks? While explaining to my friends how does TAP test works I wrote an example TAP test. May be we we should add it to the core with sensible README explanation? --