diff options
| author | Daniel Gustafsson | 2025-11-14 22:44:56 +0000 |
|---|---|---|
| committer | Daniel Gustafsson | 2025-11-14 22:44:56 +0000 |
| commit | 446568c22207795da02e26b6b2956a61bd17e912 (patch) | |
| tree | 7fccffc1e6498d62e4f25f548a7ed4dbe79975b1 | |
| parent | 478c4814a05262c0312c813bf393c4736d76f3f9 (diff) | |
All GUCs in postgresql.conf.sample should be set to the default
value and be commented out. This syntax was however not tested
for, making omissions easy to miss. Add a test which check all
lines for syntax.
Author: Daniel Gustafsson <[email protected]>
Reviewed-by: Andrew Dunstan <[email protected]>
Discussion: https://postgr.es/m/[email protected]
| -rw-r--r-- | src/test/modules/test_misc/t/003_check_guc.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/modules/test_misc/t/003_check_guc.pl b/src/test/modules/test_misc/t/003_check_guc.pl index 5ae23192a47..51349e98e93 100644 --- a/src/test/modules/test_misc/t/003_check_guc.pl +++ b/src/test/modules/test_misc/t/003_check_guc.pl @@ -56,7 +56,7 @@ while (my $line = <$contents>) # file. # - Valid configuration options are followed immediately by " = ", # with one space before and after the equal sign. - if ($line =~ m/^#?([_[:alnum:]]+) = .*/) + if ($line =~ m/^#([_[:alnum:]]+) = .*/) { # Lower-case conversion matters for some of the GUCs. my $param_name = lc($1); @@ -69,7 +69,12 @@ while (my $line = <$contents>) # Update the list of GUCs found in the sample file, for the # follow-up tests. push @gucs_in_file, $param_name; + + next; } + # Make sure each line starts with either a # or whitespace + fail("$line missing initial # in postgresql.conf.sample") + if $line =~ /^\s*[^#\s]/; } close $contents; |
