From 0dcca2925e699749886f4c5d4e339ec605bb0e94 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 1 Mar 2012 00:06:25 +0000 Subject: (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 --- t/helper.pm | 2 ++ 1 file changed, 2 insertions(+) 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"); } -- cgit v1.2.1