xref: /openbsd-src/gnu/usr.bin/perl/cpan/Text-Tabs/t/undef.t (revision 256a93a44f36679bee503f12e49566c2183f6181)
1*256a93a4Safresh1use strict; use warnings;
2*256a93a4Safresh1
3*256a93a4Safresh1BEGIN { require './t/lib/ok.pl' }
4*256a93a4Safresh1use Text::Tabs;
5*256a93a4Safresh1use Text::Wrap;
6*256a93a4Safresh1
7*256a93a4Safresh1print "1..4\n";
8*256a93a4Safresh1
9*256a93a4Safresh1my $w; $SIG{'__WARN__'} = sub { $w = join '', @_ };
10*256a93a4Safresh1
11*256a93a4Safresh1sub cleanup { diag $w; undef $w }
12*256a93a4Safresh1
13*256a93a4Safresh1expand( undef );
14*256a93a4Safresh1ok( !defined $w, 'expand accepts undef silently' ) or cleanup;
15*256a93a4Safresh1
16*256a93a4Safresh1unexpand( undef, undef, undef );
17*256a93a4Safresh1ok( !defined $w, 'unexpand accepts undef silently' ) or cleanup;
18*256a93a4Safresh1
19*256a93a4Safresh1wrap( undef, undef, undef, ( ( "abc " x 20 ) . "abc\n" ) x 5, undef );
20*256a93a4Safresh1ok( !defined $w, 'wrap accepts undef silently' ) or cleanup;
21*256a93a4Safresh1
22*256a93a4Safresh1fill( undef, undef, undef, ( ( "abc " x 20 ) . "abc\n" ) x 5, undef );
23*256a93a4Safresh1ok( !defined $w, 'fill accepts undef silently' ) or cleanup;
24