Make PostgreSQL::Test::Cluster::config_data more flexible
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 13 Nov 2022 13:45:14 +0000 (08:45 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 13 Nov 2022 14:00:38 +0000 (09:00 -0500)
commita688c39e1dca56490527ccac13ea4ac752c7116a
treec31c2a241ecff616099176ae266bd481e271fc05
parentc727f511bd7bf3c58063737bcf7a8f331346f253
Make PostgreSQL::Test::Cluster::config_data more flexible

Currently this only allows for one argument, which must be present, and
always returns a single string. With this change the following now all
work:

  $all_config = $node->config_data;
  %config_map = ($node->config_data);
  $incdir = $node->config_data('--include-dir');
  ($incdir, $sharedir) = $node->config_data(
      qw(--include-dir --share-dir));

Backpatch to release 15 where this was introduced.

Discussion: https://postgr.es/m/73eea68e-3b6f-5f63-6024-25ed26b52016@dunslane.net

Reviewed by Tom Lane, Alvaro Herrera, Michael Paquier.
src/test/perl/PostgreSQL/Test/Cluster.pm