From 99c2da94ecbeacf997270dd26fc5c0a63ffcedd4 Mon Sep 17 00:00:00 2001 From: Georgios Kokolatos Date: Thu, 2 Mar 2023 16:10:03 +0000 Subject: [PATCH vX] Add test for backwards compatible -Z0 option in pg_dump Commit 5e73a6048 expanded pg_dump with the ability to use compression specifications. A commonly shared code which lets the user control in an extended way the method, level, and other details of a desired compression. Prior to this commit, pg_dump could only accept an integer for the -Z/--compress option. An integer value of 0 had the special meaning of non compression. Commit 5e73a6048 respected and maintained this behaviour for backwards compatibility. However no tests covered this scenario. The current commit adds coverage for this case. --- src/bin/pg_dump/t/002_pg_dump.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl index 7b5a6e190c..ec7aaab884 100644 --- a/src/bin/pg_dump/t/002_pg_dump.pl +++ b/src/bin/pg_dump/t/002_pg_dump.pl @@ -76,6 +76,19 @@ my %pgdump_runs = ( ], }, + # Verify that the backwards compatible option -Z0 produces + # non compressed output + compression_none_plain => { + test_key => 'compression', + # Enforce this test when compile option is available + compile_option => 'gzip', + dump_cmd => [ + 'pg_dump', '--format=plain', + '-Z0', "--file=$tempdir/compression_none_plain.sql", + 'postgres', + ], + }, + # Do not use --no-sync to give test coverage for data sync. compression_gzip_custom => { test_key => 'compression', -- 2.34.1