8 unless (find PerlIO::Layer 'perlio') {
9 print "1..0 # Skip: PerlIO not used\n";
12 if (ord("A") == 193) {
13 print "1..0 # Skip: EBCDIC\n";
17 use Test::More tests => 11;
19 BEGIN { use_ok('PerlIO::via::QuotedPrint') }
22 This is a tést for quoted-printable text that has hàrdly any speçial characters
27 This is a t=E9st for quoted-printable text that has h=E0rdly any spe=E7ial =
32 # Create the encoded test-file
35 open( my $out,'>:via(PerlIO::via::QuotedPrint)', $file ),
36 "opening '$file' for writing"
39 ok( (print $out $decoded), 'print to file' );
40 ok( close( $out ), 'closing encoding handle' );
42 # Check encoding without layers
46 ok( open( my $test,$file ), 'opening without layer' );
47 is( $encoded,readline( $test ), 'check encoded content' );
48 ok( close( $test ), 'close test handle' );
51 # Check decoding _with_ layers
54 open( my $in,'<:via(QuotedPrint)', $file ),
55 "opening '$file' for reading"
57 is( $decoded,join( '',<$in> ), 'check decoding' );
58 ok( close( $in ), 'close decoding handle' );
60 # Remove whatever we created now
62 ok( unlink( $file ), "remove test file '$file'" );