]> Dogcows Code - chaz/p5-File-KDBX/blobdiff - t/database.t
add initial WIP
[chaz/p5-File-KDBX] / t / database.t
diff --git a/t/database.t b/t/database.t
new file mode 100644 (file)
index 0000000..951ff74
--- /dev/null
@@ -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;
This page took 0.02017 seconds and 4 git commands to generate.