From 69949786a09933d2634c8f89f7ca0b32df3063a9 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 27 Feb 2012 20:42:17 +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(+) (limited to 't/helper.pm') 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