diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2021-06-05 17:12:34 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2022-04-27 00:03:14 +0200 |
commit | d8460fc3d17b57dbb4048fe7911cf80644797095 (patch) | |
tree | 86f6517b509b5862067fa82528114292847db3a1 | |
parent | f4894c3dfbc6dfce0bc02d260827c96499cd0226 (diff) | |
download | perl-RPM4-d8460fc3d17b57dbb4048fe7911cf80644797095.tar perl-RPM4-d8460fc3d17b57dbb4048fe7911cf80644797095.tar.gz perl-RPM4-d8460fc3d17b57dbb4048fe7911cf80644797095.tar.bz2 perl-RPM4-d8460fc3d17b57dbb4048fe7911cf80644797095.tar.xz perl-RPM4-d8460fc3d17b57dbb4048fe7911cf80644797095.zip |
Split callback so that it can be reused
-rw-r--r-- | RPM4/t/05transaction.t | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/RPM4/t/05transaction.t b/RPM4/t/05transaction.t index 16da607..4e10cea 100644 --- a/RPM4/t/05transaction.t +++ b/RPM4/t/05transaction.t @@ -75,7 +75,7 @@ ok($ts->transcheck == 0, "Checking transaction works"); ok($ts->transorder == 0, "Run transaction order"); ok(defined($ts->transflag([qw(JUSTDB)])), "Set transflags"); -ok($ts->transrun(sub { my %a = @_; print STDERR "$a{what} $a{amount} / $a{total}\n" }) == 0, "Running transaction justdb"); +ok($ts->transrun(\&callback) == 0, "Running transaction justdb"); my $found = 0; my $roffset; @@ -148,3 +148,8 @@ isa_ok($spec, 'RPM4::Spec', 'ts->newspec'); $ts = undef; # explicitely calling DESTROY to close database rmtree($tempdir); + +sub callback { + my %a = @_; + print STDERR "$a{what} $a{amount} / $a{total}\n"; +} |