0001-pg_dump-test-Make-concatenated-create_sql-commands-m.patch
text/plain
Filename: 0001-pg_dump-test-Make-concatenated-create_sql-commands-m.patch
Type: text/plain
Part: 0
Patch
Format: format-patch
Series: patch 0001
Subject: pg_dump test: Make concatenated create_sql commands more readable
| File | + | − |
|---|---|---|
| src/bin/pg_dump/t/002_pg_dump.pl | 6 | 2 |
From 28e70332050e81c3faebc1bd0fe31e5863adcb78 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Sat, 22 Oct 2022 12:29:26 +0200
Subject: [PATCH] pg_dump test: Make concatenated create_sql commands more
readable
---
src/bin/pg_dump/t/002_pg_dump.pl | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
index a869321cdfc3..5df5a0ad59ef 100644
--- a/src/bin/pg_dump/t/002_pg_dump.pl
+++ b/src/bin/pg_dump/t/002_pg_dump.pl
@@ -3984,8 +3984,12 @@
next;
}
- # Add terminating semicolon
- $create_sql{$test_db} .= $tests{$test}->{create_sql} . ";";
+ # Normalize command ending: strip all line endings, add
+ # semicolon if missing, add two newlines.
+ my $create_sql = $tests{$test}->{create_sql};
+ chomp $create_sql;
+ $create_sql .= ';' unless substr($create_sql, -1) eq ';';
+ $create_sql{$test_db} .= $create_sql . "\n\n";
}
}
--
2.37.3