diff options
Diffstat (limited to 'src/bin/scripts/t/070_dropuser.pl')
-rw-r--r-- | src/bin/scripts/t/070_dropuser.pl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/bin/scripts/t/070_dropuser.pl b/src/bin/scripts/t/070_dropuser.pl new file mode 100644 index 0000000..e4eac21 --- /dev/null +++ b/src/bin/scripts/t/070_dropuser.pl @@ -0,0 +1,28 @@ + +# Copyright (c) 2021-2022, PostgreSQL Global Development Group + +use strict; +use warnings; + +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; +use Test::More; + +program_help_ok('dropuser'); +program_version_ok('dropuser'); +program_options_handling_ok('dropuser'); + +my $node = PostgreSQL::Test::Cluster->new('main'); +$node->init; +$node->start; + +$node->safe_psql('postgres', 'CREATE ROLE regress_foobar1'); +$node->issues_sql_like( + [ 'dropuser', 'regress_foobar1' ], + qr/statement: DROP ROLE regress_foobar1/, + 'SQL DROP ROLE run'); + +$node->command_fails([ 'dropuser', 'regress_nonexistent' ], + 'fails with nonexistent user'); + +done_testing(); |