]>
Dogcows Code - chaz/p5-File-KDBX/blob - erase.t
46454aec923052622f84e2fca1646b2b93ad4a04
9 use File
::KDBX
::Util
qw(:erase);
14 my $hash1 = {foo
=> 'secret'};
15 my $array1 = [qw(bar baz)];
17 erase
$data1, \
$data2, $hash1, $array1;
18 is $data1, undef, 'Erase by alias';
19 is $data2, undef, 'Erase by reference';
20 is scalar keys %$hash1, 0, 'Erase by hashref';
21 is scalar @$array1, 0, 'Erase by arrayref';
25 my $cleanup = erase_scoped
$data3;
26 is $data3, 'hello', 'Data not yet erased';
28 is $data3, undef, 'Scoped erased';
32 my $secret = 'conspiracy';
33 my $cleanup = erase_scoped \
$secret;
39 my $thing = get_secret
();
41 is $thing, 'conspiracy', 'Data not yet erased';
43 is $thing, undef, 'Scope erased';
45 is $another, 'conspiracy', 'Data not erased in the other scalar';
This page took 0.036721 seconds and 3 git commands to generate.