mirror of
https://github.com/zebrajr/postgres.git
synced 2025-12-07 00:20:24 +01:00
Adjust new TAP test to work on macOS.
Seems Apple's version of "wc -l" puts spaces before the number. (I wonder why the cfbot didn't find this.) While here, make the failure case log what it got, to aid debugging future issues. Per buildfarm.
This commit is contained in:
parent
27da1a796f
commit
afd532c3a8
|
|
@ -25,8 +25,10 @@ my $result = IPC::Run::run [ 'wc', '-l' ],
|
||||||
'>' => \$wcstdout,
|
'>' => \$wcstdout,
|
||||||
'2>' => \$wcstderr;
|
'2>' => \$wcstderr;
|
||||||
chomp $wcstdout;
|
chomp $wcstdout;
|
||||||
if ($wcstdout ne '2' || $wcstderr ne '')
|
if ($wcstdout !~ /^ *2$/ || $wcstderr ne '')
|
||||||
{
|
{
|
||||||
|
note "wc stdout = '$wcstdout'\n";
|
||||||
|
note "wc stderr = '$wcstderr'\n";
|
||||||
plan skip_all => '"wc -l" is needed to run this test';
|
plan skip_all => '"wc -l" is needed to run this test';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -83,17 +85,17 @@ do_command(
|
||||||
|
|
||||||
do_command(
|
do_command(
|
||||||
"SELECT 'test' AS t FROM generate_series(1,24);\n",
|
"SELECT 'test' AS t FROM generate_series(1,24);\n",
|
||||||
qr/^24\r?$/m,
|
qr/^ *24\r?$/m,
|
||||||
"execute SELECT query that needs pagination");
|
"execute SELECT query that needs pagination");
|
||||||
|
|
||||||
do_command(
|
do_command(
|
||||||
"\\pset expanded\nSELECT generate_series(1,20) as g;\n",
|
"\\pset expanded\nSELECT generate_series(1,20) as g;\n",
|
||||||
qr/^39\r?$/m,
|
qr/^ *39\r?$/m,
|
||||||
"execute SELECT query that needs pagination in expanded mode");
|
"execute SELECT query that needs pagination in expanded mode");
|
||||||
|
|
||||||
do_command(
|
do_command(
|
||||||
"\\pset tuples_only off\n\\d+ information_schema.referential_constraints\n",
|
"\\pset tuples_only off\n\\d+ information_schema.referential_constraints\n",
|
||||||
qr/^\d+\r?$/m,
|
qr/^ *\d+\r?$/m,
|
||||||
"execute command with footer that needs pagination");
|
"execute command with footer that needs pagination");
|
||||||
|
|
||||||
# send psql an explicit \q to shut it down, else pty won't close properly
|
# send psql an explicit \q to shut it down, else pty won't close properly
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user