Add more TAP tests for pg_dump options with range checks

This adds two tests for --extra-float-digits and --rows-per-insert,
similar to what exists for --compress.

Author: Dong Wook Lee
Discussion: https://postgr.es/m/CAAcByaJsgrB-qc-ALb0mALprRGLAdmcBap7SZxO4kCAU-JEHcQ@mail.gmail.com
This commit is contained in:
Michael Paquier 2020-06-13 09:34:38 +09:00
parent dad75eb4a8
commit 64725728e7
1 changed files with 11 additions and 1 deletions

View File

@ -4,7 +4,7 @@ use warnings;
use Config;
use PostgresNode;
use TestLib;
use Test::More tests => 78;
use Test::More tests => 82;
my $tempdir = TestLib::tempdir;
my $tempdir_short = TestLib::tempdir_short;
@ -123,6 +123,16 @@ command_fails_like(
qr/\Qpg_dump: error: compression level must be in range 0..9\E/,
'pg_dump: compression level must be in range 0..9');
command_fails_like(
[ 'pg_dump', '--extra-float-digits', '-16' ],
qr/\Qpg_dump: error: extra_float_digits must be in range -15..3\E/,
'pg_dump: extra_float_digits must be in range -15..3');
command_fails_like(
[ 'pg_dump', '--rows-per-insert', '0' ],
qr/\Qpg_dump: error: rows-per-insert must be in range 1..2147483647\E/,
'pg_dump: rows-per-insert must be in range 1..2147483647');
command_fails_like(
[ 'pg_restore', '--if-exists', '-f -' ],
qr/\Qpg_restore: error: option --if-exists requires option -c\/--clean\E/,