]> Dogcows Code - chaz/p5-File-KDBX/blob - t/database.t
add initial WIP
[chaz/p5-File-KDBX] / t / database.t
1 #!/usr/bin/env perl
2
3 use utf8;
4 use warnings;
5 use strict;
6
7 use FindBin qw($Bin);
8 use lib "$Bin/lib";
9 use TestCommon;
10
11 use Test::More;
12
13 BEGIN { use_ok 'File::KDBX' }
14
15 subtest 'Create a new database' => sub {
16 my $kdbx = File::KDBX->new;
17
18 $kdbx->add_group(name => 'Meh');
19 ok $kdbx->_is_implicit_root, 'Database starts off with implicit root';
20
21 $kdbx->add_entry({
22 username => 'hello',
23 password => {value => 'This is a secret!!!!!', protect => 1},
24 });
25
26 ok !$kdbx->_is_implicit_root, 'Adding an entry to the root group makes it explicit';
27
28 $kdbx->unlock;
29
30 # dumper $kdbx->groups;
31
32 pass;
33 };
34
35 done_testing;
This page took 0.038428 seconds and 4 git commands to generate.