X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=t%2Fdatabase.t;fp=t%2Fdatabase.t;h=951ff74fc80cff167002a8de0b41e15b26f1cfc7;hb=f63182fc62b25269b1c38588dca2b3535ed1a1a2;hp=0000000000000000000000000000000000000000;hpb=e2deca75a6040911441e0d7c4430aeae9be69e40;p=chaz%2Fp5-File-KDBX diff --git a/t/database.t b/t/database.t new file mode 100644 index 0000000..951ff74 --- /dev/null +++ b/t/database.t @@ -0,0 +1,35 @@ +#!/usr/bin/env perl + +use utf8; +use warnings; +use strict; + +use FindBin qw($Bin); +use lib "$Bin/lib"; +use TestCommon; + +use Test::More; + +BEGIN { use_ok 'File::KDBX' } + +subtest 'Create a new database' => sub { + my $kdbx = File::KDBX->new; + + $kdbx->add_group(name => 'Meh'); + ok $kdbx->_is_implicit_root, 'Database starts off with implicit root'; + + $kdbx->add_entry({ + username => 'hello', + password => {value => 'This is a secret!!!!!', protect => 1}, + }); + + ok !$kdbx->_is_implicit_root, 'Adding an entry to the root group makes it explicit'; + + $kdbx->unlock; + + # dumper $kdbx->groups; + + pass; +}; + +done_testing;