summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/superuser--split-transactions.t37
1 files changed, 18 insertions, 19 deletions
diff --git a/t/superuser--split-transactions.t b/t/superuser--split-transactions.t
index 75fdd517..6ca5e5f2 100644
--- a/t/superuser--split-transactions.t
+++ b/t/superuser--split-transactions.t
@@ -14,27 +14,15 @@ need_root_and_prepare();
my $name = 'split-transactions';
urpmi_addmedia("$name $::pwd/media/$name");
-test_urpmi("--auto --split-length 1 c d", <<'EOF', <<'EOF');
-Preparing...
- 1/4: a
- 2/4: b
-Preparing...
- 3/4: c
-Preparing...
- 4/4: d
-EOF
-Preparing...
- 1/4: b
- 2/4: a
-Preparing...
- 3/4: c
-Preparing...
- 4/4: d
-EOF
+test_urpmi("--auto --split-length 1 c d",
+ acceptable_trans_orders(4,
+ [ [ qw(a b) ], ['c'], ['d'] ],
+ [ [ qw(b a) ], ['c'], ['d'] ],
+ ));
check_installed_names('a', 'b', 'c', 'd');
sub test_urpmi {
- my ($para, $wanted_a, $wanted_b) = @_;
+ my ($para, @wanted) = @_;
my $s = run_urpm_cmd("urpmi $para");
print $s;
@@ -43,5 +31,16 @@ sub test_urpmi {
$s =~ s/^SECURITY.*//gm;
$s =~ s/^\n//gm;
- ok(member($s, $wanted_a, $wanted_b), "$wanted_a in $s");
+ ok(member($s, @wanted), "$wanted[0] in $s");
+}
+
+sub acceptable_trans_orders {
+ my ($total, @solutions) = @_;
+ my @res;
+ foreach (@solutions) {
+ my $count = 0;
+ push @res, join("\n", map {
+ ("Preparing...", map { $count++; " $count/$total: $_" } @$_) } @$_) . "\n";
+ }
+ @res;
}