]> Dogcows Code - chaz/p5-File-KDBX/blobdiff - t/kdb.t
Change custom icons to an array
[chaz/p5-File-KDBX] / t / kdb.t
diff --git a/t/kdb.t b/t/kdb.t
index 6e1cda69f315ed030ea3b7f2ee6e9f82f8d58b92..c16aaf8b19ef1c3be3d5d3487c50f82d79a50beb 100644 (file)
--- a/t/kdb.t
+++ b/t/kdb.t
@@ -92,18 +92,19 @@ for my $test (
 
 sub test_custom_icons {
     my $kdbx = shift;
+    $kdbx = $kdbx->() if ref $kdbx eq 'CODE';
 
-    my ($uuid, @other) = keys %{$kdbx->custom_icons};
-    ok $uuid, 'Database has a custom icon';
+    my ($icon, @other) = @{$kdbx->custom_icons};
+    ok $icon, 'Database has a custom icon';
     is scalar @other, 0, 'Database has no other icons';
 
-    my $data = $kdbx->custom_icon_data($uuid);
-    like $data, qr/^\x89PNG\r\n/, 'Custom icon is a PNG';
+    like $icon->{data}, qr/^\x89PNG\r\n/, 'Custom icon is a PNG';
 }
 for my $test (
     ['Custom icons' => $kdbx],
-    ['Custom icons after dump & load roundtrip'
-        => File::KDBX->load_string($kdbx->dump_string('a', allow_upgrade => 0, randomize_seeds => 0), 'a')],
+    ['Custom icons after dump & load roundtrip' => sub {
+        File::KDBX->load_string($kdbx->dump_string('a', allow_upgrade => 0, randomize_seeds => 0), 'a');
+    }],
 ) {
     my ($name, $kdbx) = @$test;
     subtest $name, \&test_custom_icons, $kdbx;
This page took 0.019439 seconds and 4 git commands to generate.