\unset ECHO
\set QUIET 1

\pset format unaligned
\pset tuples_only true
\pset pager off

\set ON_ERROR_ROLLBACK 1
\set ON_ERROR_STOP on

SET client_min_messages TO WARNING;

CREATE ROLE bobo with login password 'foo';

CREATE EXTENSION IF NOT EXISTS pgtap;

CREATE EXTENSION pgsodium;

BEGIN;
SELECT * FROM no_plan();



SET search_path = pgsodium, public;

SELECT EXISTS (SELECT * FROM pg_settings
    WHERE name = 'shared_preload_libraries'
    AND setting ilike '%pgsodium%') serverkeys \gset

SELECT pg_version_num() / 10000 major_version \gset
SELECT :major_version = 15 pg15 \gset

\ir pgsodium_schema.sql
\ir random.sql
\ir secretbox.sql
\ir secretstream.sql
\ir stream.sql
\ir aead.sql
\ir auth.sql
\ir hash.sql
\ir box.sql
\ir sign.sql
\ir pwhash.sql
\ir kdf.sql
\ir kx.sql
\ir sha2.sql
\ir hmac.sql
\ir derive.sql
\ir signcrypt.sql
\ir helpers.sql
\ir tce.sql
\ir tce_rls.sql
\ir keys.sql

select * from finish();
ROLLBACK;
