From d8460fc3d17b57dbb4048fe7911cf80644797095 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 5 Jun 2021 17:12:34 +0200 Subject: Split callback so that it can be reused --- RPM4/t/05transaction.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"; +} -- cgit v1.2.1