diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2021-06-05 17:16:18 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2022-04-27 00:03:16 +0200 |
commit | c082c1bb2bc0b0133e428a27c0e59ad830891bc8 (patch) | |
tree | fa473937ebc9329a830958fa37cd0c1c34195d11 /RPM4 | |
parent | d8460fc3d17b57dbb4048fe7911cf80644797095 (diff) | |
download | perl-RPM4-c082c1bb2bc0b0133e428a27c0e59ad830891bc8.tar perl-RPM4-c082c1bb2bc0b0133e428a27c0e59ad830891bc8.tar.gz perl-RPM4-c082c1bb2bc0b0133e428a27c0e59ad830891bc8.tar.bz2 perl-RPM4-c082c1bb2bc0b0133e428a27c0e59ad830891bc8.tar.xz perl-RPM4-c082c1bb2bc0b0133e428a27c0e59ad830891bc8.zip |
Split process_problems() for late reuse
Diffstat (limited to 'RPM4')
-rw-r--r-- | RPM4/t/05transaction.t | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/RPM4/t/05transaction.t b/RPM4/t/05transaction.t index 4e10cea..070c918 100644 --- a/RPM4/t/05transaction.t +++ b/RPM4/t/05transaction.t @@ -42,21 +42,7 @@ ok($ts->transadd($hd, "$Bin/test-dep-1.0-1mdk.noarch.rpm") == 0, "Adding a packa ok($ts->transcheck == 0, "Checking transaction works"); ok($ts->transorder == 0, "Run transaction order"); -my $pbs = RPM4::Transaction::Problems->new($ts); -isa_ok( - $pbs, - 'RPM4::Transaction::Problems', - 'Can retrieve pb from transaction' -); - -ok($pbs->count, "Can get number of problems"); - -ok($pbs->init || 1, "Resetting problems counter"); -my $strpb; -while ($pbs->hasnext) { - $strpb .= $pbs->problem; -} -ok($strpb, "Can get problem description"); +process_problems(); ok(defined($ts->transflag([qw(TEST)])), "Set transflags"); #ok($ts->transrun([ qw(LABEL PERCENT) ]) == 0, "Running test transaction"); @@ -153,3 +139,21 @@ sub callback { my %a = @_; print STDERR "$a{what} $a{amount} / $a{total}\n"; } + +sub process_problems() { + my $pbs = RPM4::Transaction::Problems->new($ts); + isa_ok( + $pbs, + 'RPM4::Transaction::Problems', + 'Can retrieve pb from transaction' + ); + + ok($pbs->count, "Can get number of problems"); + + ok($pbs->init || 1, "Resetting problems counter"); + my $strpb; + while ($pbs->hasnext) { + $strpb .= $pbs->problem; + } + ok($strpb, "Can get problem description"); +} |