1 ##!/usr/local/bin/perl -w
7 use Test::More tests => 9 ;
9 my $file = 'missing/file' ;
14 'croak' => \&test_croak,
15 'carp' => \&test_carp,
16 'quiet' => \&test_quiet,
19 while( my( $mode, $sub ) = each %modes ) {
21 $sub->( 'read_file', \&read_file, $file, err_mode => $mode ) ;
22 $sub->( 'write_file', \&write_file, $file,
23 { err_mode => $mode }, 'junk' ) ;
24 $sub->( 'read_dir', \&read_dir, $file, err_mode => $mode ) ;
30 my ( $name, $sub, @args ) = @_ ;
36 ok( $@, "$name can croak" ) ;
41 my ( $name, $sub, @args ) = @_ ;
43 local $SIG{__WARN__} = sub { ok( 1, "$name can carp" ) } ;
50 my ( $name, $sub, @args ) = @_ ;
52 local $SIG{__WARN__} = sub { ok( 0, "$name can be quiet" ) } ;
58 ok( !$@, "$name can be quiet" ) ;