6 require "../t/test.pl";
7 skip_all("No perlio") unless (find PerlIO::Layer 'perlio');
14 $SIG{__WARN__} = sub { $warn = shift };
16 END { 1 while unlink($file) }
18 ok(open(FH,">",$file),"Create works");
20 ok(open(FH,"<",$file),"Normal open works");
23 ok(!binmode(FH,":-)"),"All punctuation fails binmode");
25 isnt($!,0,"Got errno");
26 like($warn,qr/in PerlIO layer/,"Got warning");
29 ok(!binmode(FH,":nonesuch"),"Bad package fails binmode");
31 isnt($!,0,"Got errno");
32 like($warn,qr/nonesuch/,"Got warning");
36 ok(!open(FH,"<:-)",$file),"All punctuation fails open");
38 isnt($!,"","Got errno");
39 like($warn,qr/in PerlIO layer/,"Got warning");
42 ok(!open(FH,"<:nonesuch",$file),"Bad package fails open");
44 isnt($!,0,"Got errno");
45 like($warn,qr/nonesuch/,"Got warning");
47 ok(open(FH,"<",$file),"Normal open (still) works");