From: Steve Peters Date: Tue, 2 May 2006 02:47:43 +0000 (+0000) Subject: Escape prompts with #'s to avoid causing tests to fail from X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=01d24961363e0071df30adb4d21737db6ba1878b;p=p5sagit%2Fp5-mst-13.2.git Escape prompts with #'s to avoid causing tests to fail from the unexpected output. p4raw-id: //depot/perl@28045 --- diff --git a/lib/Module/Build/t/extend.t b/lib/Module/Build/t/extend.t index 1983d79..9a76851 100644 --- a/lib/Module/Build/t/extend.t +++ b/lib/Module/Build/t/extend.t @@ -230,20 +230,20 @@ print "Hello, World!\n"; $ENV{PERL_MM_USE_DEFAULT} = 1; - eval{ $mb->y_n("Is this a question?") }; + eval{ $mb->y_n("# Is this a question?") }; like $@, qr/ERROR:/, 'Do not allow default-less y_n() for unattended builds'; - eval{ $ans = $mb->prompt('Is this a question?') }; + eval{ $ans = $mb->prompt('# Is this a question?') }; like $@, qr/ERROR:/, 'Do not allow default-less prompt() for unattended builds'; $ENV{PERL_MM_USE_DEFAULT} = 0; - $ans = $mb->prompt('Is this a question?'); + $ans = $mb->prompt('# Is this a question?'); print "\n"; # fake after input is $ans, 'y', "prompt() doesn't require default for interactive builds"; - $ans = $mb->y_n('Say yes'); + $ans = $mb->y_n('# Say yes'); print "\n"; # fake after input ok $ans, "y_n() doesn't require default for interactive build"; @@ -251,13 +251,13 @@ print "Hello, World!\n"; # Test Defaults *{Module::Build::_readline} = sub { '' }; - $ans = $mb->prompt("Is this a question"); + $ans = $mb->prompt("# Is this a question"); is $ans, '', "default for prompt() without a default is ''"; - $ans = $mb->prompt("Is this a question", 'y'); + $ans = $mb->prompt("# Is this a question", 'y'); is $ans, 'y', " prompt() with a default"; - $ans = $mb->y_n("Is this a question", 'y'); + $ans = $mb->y_n("# Is this a question", 'y'); ok $ans, " y_n() with a default"; }