-- Test schemas
set client_min_messages to warning;
create extension if not exists pgtap;
reset client_min_messages;

begin;

select plan(21);

select schemas_are(array [
	'auth',
	'camper',
	'public',
	'sqitch'
]);

select schema_privs_are('auth', 'guest', array []::text[]);
select schema_privs_are('auth', 'employee', array []::text[]);
select schema_privs_are('auth', 'admin', array []::text[]);
select schema_privs_are('auth', 'authenticator', array []::text[]);
select schema_privs_are('auth', 'public', array []::text[]);

select schema_privs_are('camper', 'guest', array ['USAGE']);
select schema_privs_are('camper', 'employee', array ['USAGE']);
select schema_privs_are('camper', 'admin', array ['USAGE']);
select schema_privs_are('camper', 'authenticator', array []::text[]);
select schema_privs_are('camper', 'public', array []::text[]);

select schema_privs_are('public', 'guest', array ['USAGE']);
select schema_privs_are('public', 'employee', array ['USAGE']);
select schema_privs_are('public', 'admin', array ['USAGE']);
select schema_privs_are('public', 'authenticator', array ['USAGE']);
select schema_privs_are('public', 'public', array []::text[]);

select schema_privs_are('sqitch', 'guest', array []::text[]);
select schema_privs_are('sqitch', 'employee', array []::text[]);
select schema_privs_are('sqitch', 'admin', array []::text[]);
select schema_privs_are('sqitch', 'authenticator', array []::text[]);
select schema_privs_are('sqitch', 'public', array []::text[]);

select *
from finish();

rollback;