Confusing TAP tests readme file

Поиск
Список
Период
Сортировка
От Ildar Musin
Тема Confusing TAP tests readme file
Дата
Msg-id 5795ED19.3070208@postgrespro.ru
обсуждение исходный текст
Ответы Re: Confusing TAP tests readme file  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Hi all,

I was checking out TAP tests documentation. And I found confusing this
part of src/test/perl/README file:

     my $ret = $node->psql('postgres', 'SELECT 1');
     is($ret, '1', 'SELECT 1 returns 1');

The returning value of psql() function is the exit code of the psql.
Hence this test will never pass since psql returns 0 if query was
successfully executed. Probably it was meant to be the safe_psql()
function instead which returns stdout:

     my $ret = $node->safe_psql('postgres', 'SELECT 1');
     is($ret, '1', 'SELECT 1 returns 1');

or else:

     my ($ret, $stdout, $stderr) =
         $node->psql('postgres', 'SELECT 1');
     is($stdout, '1', 'SELECT 1 returns 1');

The attached patch fixes this.

Regards,
Ildar Musin

--
Ildar Musin
i.musin@postgrespro.ru


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Borodin
Дата:
Сообщение: Re: Re: GiST optimizing memmoves in gistplacetopage for fixed-size updates [PoC]
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Optimizing numeric SUM() aggregate