aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/t/050_dropdb.pl
blob: 3065e5051df77b8f20196c69be86985c61a2c2db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use warnings;
use TestLib;
use Test::More tests => 11;

program_help_ok('dropdb');
program_version_ok('dropdb');
program_options_handling_ok('dropdb');

my $tempdir = tempdir;
start_test_server $tempdir;

psql 'postgres', 'CREATE DATABASE foobar1';
issues_sql_like(
	[ 'dropdb', 'foobar1' ],
	qr/statement: DROP DATABASE foobar1/,
	'SQL DROP DATABASE run');

command_fails([ 'dropdb', 'nonexistent' ], 'fails with nonexistent database');