diff options
author | Steve Peters <steve@fisharerojo.org> | 2006-05-05 16:26:48 +0000 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-05-05 16:26:48 +0000 |
commit | f4892442dfa01b3fabfea640ca8f25af35c76aa1 (patch) | |
tree | 13ce74097be9dfff8d9b687e6cd4c93e2af77be8 | |
parent | a59118671308b89f1214a83fc0db2e393a19affb (diff) | |
download | perl-f4892442dfa01b3fabfea640ca8f25af35c76aa1.tar.gz |
These Module::Build tests depended on STDIN. Unfortunately, cron
closes STDIN, so these build failures were only seen while
running smokes through cron.
p4raw-id: //depot/perl@28108
-rw-r--r-- | lib/Module/Build/t/extend.t | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/lib/Module/Build/t/extend.t b/lib/Module/Build/t/extend.t index 9a76851a32..2c4a50367a 100644 --- a/lib/Module/Build/t/extend.t +++ b/lib/Module/Build/t/extend.t @@ -227,38 +227,41 @@ print "Hello, World!\n"; eval{ $mb->y_n('Prompt?', 'invalid default') }; like $@, qr/Invalid default/, "y_n() requires a default of 'y' or 'n'"; + SKIP:{ - $ENV{PERL_MM_USE_DEFAULT} = 1; + skip "No available STDIN", 7 unless -t STDIN; - eval{ $mb->y_n("# Is this a question?") }; - like $@, qr/ERROR:/, 'Do not allow default-less y_n() for unattended builds'; + $ENV{PERL_MM_USE_DEFAULT} = 1; - eval{ $ans = $mb->prompt('# Is this a question?') }; - like $@, qr/ERROR:/, 'Do not allow default-less prompt() for unattended builds'; + 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?') }; + like $@, qr/ERROR:/, 'Do not allow default-less prompt() for unattended builds'; - $ENV{PERL_MM_USE_DEFAULT} = 0; + $ENV{PERL_MM_USE_DEFAULT} = 0; - $ans = $mb->prompt('# Is this a question?'); - print "\n"; # fake <enter> after input - is $ans, 'y', "prompt() doesn't require default for interactive builds"; + $ans = $mb->prompt('# Is this a question?'); + print "\n"; # fake <enter> after input + is $ans, 'y', "prompt() doesn't require default for interactive builds"; - $ans = $mb->y_n('# Say yes'); - print "\n"; # fake <enter> after input - ok $ans, "y_n() doesn't require default for interactive build"; + $ans = $mb->y_n('# Say yes'); + print "\n"; # fake <enter> after input + ok $ans, "y_n() doesn't require default for interactive build"; - # Test Defaults - *{Module::Build::_readline} = sub { '' }; + # Test Defaults + *{Module::Build::_readline} = sub { '' }; - $ans = $mb->prompt("# Is this a question"); - is $ans, '', "default for prompt() without a default is ''"; + $ans = $mb->prompt("# Is this a question"); + is $ans, '', "default for prompt() without a default is ''"; - $ans = $mb->prompt("# Is this a question", 'y'); - is $ans, 'y', " prompt() with a default"; + $ans = $mb->prompt("# Is this a question", 'y'); + is $ans, 'y', " prompt() with a default"; - $ans = $mb->y_n("# Is this a question", 'y'); - ok $ans, " y_n() with a default"; + $ans = $mb->y_n("# Is this a question", 'y'); + ok $ans, " y_n() with a default"; + } } # cleanup |