1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-19 15:49:24 +03:00

Fix TAP tests to use only standard command-line argument ordering.

Some of the TAP tests were supposing that PG programs would accept switches
after non-switch arguments on their command lines.  While GNU getopt_long()
does allow that, our own implementation does not, and it's nowhere
suggested in our documentation that such cases should work.  Adjust the
tests to use only the documented syntax.

Back-patch to 9.4, since without this the TAP tests fail when run with
src/port's getopt_long() implementation.

Michael Paquier
This commit is contained in:
Tom Lane
2015-04-04 13:34:23 -04:00
parent 368b7c601e
commit c67a86f7da
4 changed files with 10 additions and 10 deletions

View File

@@ -21,6 +21,6 @@ command_fails([ 'clusterdb', '-t', 'nonexistent', 'postgres' ],
psql 'postgres',
'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x';
issues_sql_like(
[ 'clusterdb', 'postgres', '-t', 'test1' ],
[ 'clusterdb', '-t', 'test1', 'postgres' ],
qr/statement: CLUSTER test1;/,
'cluster specific table');

View File

@@ -15,7 +15,7 @@ issues_sql_like(
qr/statement: CREATE DATABASE foobar1/,
'SQL CREATE DATABASE run');
issues_sql_like(
[ 'createdb', 'foobar2', '-l', 'C', '-E', 'LATIN1', '-T', 'template0' ],
[ 'createdb', '-l', 'C', '-E', 'LATIN1', '-T', 'template0', 'foobar2' ],
qr/statement: CREATE DATABASE foobar2 ENCODING 'LATIN1'/,
'create database with encoding');

View File

@@ -20,18 +20,18 @@ issues_sql_like(
psql 'postgres',
'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a);';
issues_sql_like(
[ 'reindexdb', 'postgres', '-t', 'test1' ],
[ 'reindexdb', '-t', 'test1', 'postgres' ],
qr/statement: REINDEX TABLE test1;/,
'reindex specific table');
issues_sql_like(
[ 'reindexdb', 'postgres', '-i', 'test1x' ],
[ 'reindexdb', '-i', 'test1x', 'postgres' ],
qr/statement: REINDEX INDEX test1x;/,
'reindex specific index');
issues_sql_like(
[ 'reindexdb', 'postgres', '-S', 'pg_catalog' ],
[ 'reindexdb', '-S', 'pg_catalog', 'postgres' ],
qr/statement: REINDEX SCHEMA pg_catalog;/,
'reindex specific schema');
issues_sql_like(
[ 'reindexdb', 'postgres', '-s' ],
[ 'reindexdb', '-s', 'postgres' ],
qr/statement: REINDEX SYSTEM postgres;/,
'reindex system tables');