v7-0001-misc-tests-for-pg_dumpall.no-cfbot

application/octet-stream

Filename: v7-0001-misc-tests-for-pg_dumpall.no-cfbot
Type: application/octet-stream
Part: 0
Message: Re: Non-text mode for pg_dumpall
From 339e813a137e5c215073b40d508b24ba2312d1ca Mon Sep 17 00:00:00 2001
From: jian he <jian.universality@gmail.com>
Date: Sat, 11 Jan 2025 13:43:34 +0800
Subject: [PATCH v7 1/1] misc tests for pg_dumpall

---
 src/bin/pg_dump/t/001_basic.pl              | 4 ++++
 src/bin/pg_dump/t/005_pg_dump_filterfile.pl | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/src/bin/pg_dump/t/001_basic.pl b/src/bin/pg_dump/t/001_basic.pl
index 214240f1ae..2d246e0a50 100644
--- a/src/bin/pg_dump/t/001_basic.pl
+++ b/src/bin/pg_dump/t/001_basic.pl
@@ -226,4 +226,8 @@ command_fails_like(
 	'pg_dumpall: option --exclude-database cannot be used together with -g/--globals-only'
 );
 
+command_fails_like(
+	[ 'pg_dumpall', '--format', 'x' ],
+	qr/\Qpg_dumpall: error: invalid dump format "x" specified\E/,
+	'pg_dumpall: invalid dump format');
 done_testing();
diff --git a/src/bin/pg_dump/t/005_pg_dump_filterfile.pl b/src/bin/pg_dump/t/005_pg_dump_filterfile.pl
index 3568a246b2..fecd3478dd 100644
--- a/src/bin/pg_dump/t/005_pg_dump_filterfile.pl
+++ b/src/bin/pg_dump/t/005_pg_dump_filterfile.pl
@@ -529,6 +529,14 @@ command_fails_like(
 
 #########################################
 # pg_restore tests
+command_fails_like(
+	[
+		'pg_restore', '-p', $port, '-f', $plainfile,
+		"--exclude-database=grabadge",
+		'--globals-only'
+	],
+	qr/\Qg_restore: error: option --exclude-database cannot be used together with -g\/--globals-only\E/,
+	'pg_restore: option --exclude-database cannot be used together with -g/--globals-only');
 
 command_ok(
 	[
-- 
2.34.1