]>
Dogcows Code - chaz/p5-File-KDBX/blob - t/references.t
12 my $kdbx = File
::KDBX-
>new;
13 my $entry1 = $kdbx->add_entry(
14 title
=> 'Sun Valley Bank Inc.',
18 my $entry2 = $kdbx->add_entry(
19 title
=> 'Donut Shoppe',
22 testcustom
=> 'a custom string',
24 my $entry3 = $kdbx->add_entry(
25 title
=> 'Sun Clinic Inc.',
27 password
=> 'password',
28 mycustom
=> 'this is another custom string',
32 ['{REF:U@T:donut}', 'freddy'],
33 ['U@T:donut', 'freddy'],
34 [[U
=> T
=> 'donut'], 'freddy', 'A reference can be pre-parsed parameters'],
36 ['{REF:U@T:sun inc}', 'fred'],
37 ['{REF:U@T:"Sun Clinic Inc."}', 'jerry'],
39 ['{REF:U@I:' . $entry2->id . '}', 'freddy', 'Resolve a field by UUID'],
41 ['{REF:U@O:custom}', 'freddy'],
42 ['{REF:U@O:"another custom"}', 'jerry'],
44 ['{REF:U@T:donut meh}', undef],
45 ['{REF:O@U:freddy}', undef],
47 my ($ref, $expected, $note) = @$test;
48 $note //= "Reference: $ref";
49 is $kdbx->resolve_reference(ref $ref eq 'ARRAY' ? @$ref : $ref), $expected, $note;
This page took 0.036245 seconds and 4 git commands to generate.