diff options
author | Andrew Dunstan | 2017-04-15 22:43:13 +0000 |
---|---|---|
committer | Andrew Dunstan | 2017-04-15 22:50:20 +0000 |
commit | 033b969edde62c84ee15b53972ee638150a28c90 (patch) | |
tree | 06aa717e71b4dced3804823c64e91992774e24a1 | |
parent | a74740fbd3bb89cd626f6e98417847f696e60bd8 (diff) |
Make sure to run one initdb TAP test with no TZ set
That way we make sure that initdb's time zone setting code is exercised.
This doesn't add an extra test, it just alters an existing test.
Discussion: <https://postgr.es/m/[email protected]>
-rw-r--r-- | src/bin/initdb/t/001_initdb.pl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bin/initdb/t/001_initdb.pl b/src/bin/initdb/t/001_initdb.pl index 372865d3f7..11d05c4647 100644 --- a/src/bin/initdb/t/001_initdb.pl +++ b/src/bin/initdb/t/001_initdb.pl @@ -34,8 +34,16 @@ command_fails( 'role names cannot begin with "pg_"'); mkdir $datadir; -command_ok([ 'initdb', '-N', '-T', 'german', '-X', $xlogdir, $datadir ], - 'successful creation'); +# make sure we run one successful test without a TZ setting so we test +# initdb's time zone setting code +{ + # delete local only works from perl 5.12, so use the older way to do this + local (%ENV) = %ENV; + delete $ENV{TZ}; + + command_ok([ 'initdb', '-N', '-T', 'german', '-X', $xlogdir, $datadir ], + 'successful creation'); +} command_ok([ 'initdb', '-S', $datadir ], 'sync only'); command_fails([ 'initdb', $datadir ], 'existing data directory'); |