summaryrefslogtreecommitdiffstats
path: root/t/helper.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-01 00:06:25 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-01 00:06:25 +0000
commit0dcca2925e699749886f4c5d4e339ec605bb0e94 (patch)
treeb7337699c61f4e1bd5612cb7be110212dcaf3f97 /t/helper.pm
parent527c63512336bd6c0fe1be69c261d97b79edc585 (diff)
downloadurpmi-0dcca2925e699749886f4c5d4e339ec605bb0e94.tar
urpmi-0dcca2925e699749886f4c5d4e339ec605bb0e94.tar.gz
urpmi-0dcca2925e699749886f4c5d4e339ec605bb0e94.tar.bz2
urpmi-0dcca2925e699749886f4c5d4e339ec605bb0e94.tar.xz
urpmi-0dcca2925e699749886f4c5d4e339ec605bb0e94.zip
(system_should_fail) on some error questions ("Do you want to...
(y/N)?"), urpmi doesn't output "\n", which breaks parsing: t/superuser--handle-conflict-deps2.t ............................ Failed 2/18 subtests (...) Test Summary Report ------------------- t/superuser--handle-conflict-deps2.t (Wstat: 0 Tests: 16 Failed: 0) Parse errors: Tests out of sequence. Found (6) but expected (5) Tests out of sequence. Found (7) but expected (6) Tests out of sequence. Found (8) but expected (7) Tests out of sequence. Found (9) but expected (8) Tests out of sequence. Found (10) but expected (9) Displayed the first 5 of 13 TAP syntax errors. Re-run prove with the -p option to see them all. eg: Continue installation anyway? (Y/n) ok 5 - should fail: echo n | perl -I.. ../urpmi --urpmi-root /urpmi/t/root -q c-2 d1-2
Diffstat (limited to 't/helper.pm')
-rw-r--r--t/helper.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/helper.pm b/t/helper.pm
index a7959dae..e3c3a008 100644
--- a/t/helper.pm
+++ b/t/helper.pm
@@ -109,6 +109,8 @@ sub system_ {
sub system_should_fail {
my ($cmd) = @_;
system($cmd);
+ # on some error questions ("Do you want to... (y/N)?"), urpmi doesn't output "\n":
+ print "\n";
$? & 127 ? is($? & 127, 0, "should fail nicely but not get killed: $cmd")
: ok($? != 0, "should fail: $cmd");
}