aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-06-13 09:34:38 +0900
committerMichael Paquier <michael@paquier.xyz>2020-06-13 09:34:38 +0900
commit64725728e790b76c97984b1029d9ffe90bcb2ec4 (patch)
tree1137309607304140a22764d8a14b0eaaf35deca9
parentdad75eb4a8d5835ecc795d7a7978e7702e4d5912 (diff)
downloadpostgresql-64725728e790b76c97984b1029d9ffe90bcb2ec4.tar.gz
postgresql-64725728e790b76c97984b1029d9ffe90bcb2ec4.zip
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
-rw-r--r--src/bin/pg_dump/t/001_basic.pl12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/bin/pg_dump/t/001_basic.pl b/src/bin/pg_dump/t/001_basic.pl
index 550eab1ee30..083fb3ad083 100644
--- a/src/bin/pg_dump/t/001_basic.pl
+++ b/src/bin/pg_dump/t/001_basic.pl
@@ -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;
@@ -124,6 +124,16 @@ command_fails_like(
'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/,
'pg_restore: option --if-exists requires option -c/--clean');