10 use Test::More tests => 11;
12 BEGIN { use_ok('PerlIO::Via::QuotedPrint') }
15 This is a tést for quoted-printable text that has hàrdly any speçial characters
20 This is a t=E9st for quoted-printable text that has h=E0rdly any spe=E7ial =
25 # Create the encoded test-file
28 open( my $out,'>:Via(PerlIO::Via::QuotedPrint)', $file ),
29 "opening '$file' for writing"
32 ok( (print $out $decoded), 'print to file' );
33 ok( close( $out ), 'closing encoding handle' );
35 # Check encoding without layers
39 ok( open( my $test,$file ), 'opening without layer' );
40 is( $encoded,readline( $test ), 'check encoded content' );
41 ok( close( $test ), 'close test handle' );
44 # Check decoding _with_ layers
47 open( my $in,'<:Via(PerlIO::Via::QuotedPrint)', $file ),
48 "opening '$file' for reading"
50 is( $decoded,join( '',<$in> ), 'check decoding' );
51 ok( close( $in ), 'close decoding handle' );
53 # Remove whatever we created now
55 ok( unlink( $file ), "remove test file '$file'" );