summaryrefslogtreecommitdiffstats
path: root/t/superuser--split-transactions.t
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-09-29 15:58:41 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-10-04 09:26:31 +0200
commitd7d29865f5a892348d8b8580c6fb825e4411cc79 (patch)
tree8f7a8788a55d2f06f443abf62a2bedfdfaea3a43 /t/superuser--split-transactions.t
parentabf47987cf0be9fda33eabd018e1adc5a87bc592 (diff)
downloadurpmi-d7d29865f5a892348d8b8580c6fb825e4411cc79.tar
urpmi-d7d29865f5a892348d8b8580c6fb825e4411cc79.tar.gz
urpmi-d7d29865f5a892348d8b8580c6fb825e4411cc79.tar.bz2
urpmi-d7d29865f5a892348d8b8580c6fb825e4411cc79.tar.xz
urpmi-d7d29865f5a892348d8b8580c6fb825e4411cc79.zip
factorize possible transaction sets definition
(needed for next commit)
Diffstat (limited to 't/superuser--split-transactions.t')
-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;
}