Add error pattern checks for some TAP tests for non-existing objects
[pgsql.git] / src / bin / scripts / t / 070_dropuser.pl
blob5f100978446b825524bd63ca83091d961ac2e9c9
2 # Copyright (c) 2021-2025, PostgreSQL Global Development Group
4 use strict;
5 use warnings FATAL => 'all';
7 use PostgreSQL::Test::Cluster;
8 use PostgreSQL::Test::Utils;
9 use Test::More;
11 program_help_ok('dropuser');
12 program_version_ok('dropuser');
13 program_options_handling_ok('dropuser');
15 my $node = PostgreSQL::Test::Cluster->new('main');
16 $node->init;
17 $node->start;
19 $node->safe_psql('postgres', 'CREATE ROLE regress_foobar1');
20 $node->issues_sql_like(
21 [ 'dropuser', 'regress_foobar1' ],
22 qr/statement: DROP ROLE regress_foobar1/,
23 'SQL DROP ROLE run');
25 $node->command_fails_like(
26 [ 'dropuser', 'regress_nonexistent' ],
27 qr/role "regress_nonexistent" does not exist/,
28 'fails with nonexistent user');
30 done_testing();