"Fossies" - the Fresh Open Source Software Archive

Member "MIME-Base64-3.16/t/unicode.t" (27 Sep 2020, 979 Bytes) of package /linux/privat/MIME-Base64-3.16.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "unicode.t": 3.15_vs_3.16.

    1 use strict;
    2 use warnings;
    3 
    4 BEGIN {
    5 	unless ($] >= 5.006) {
    6 		print "1..0\n";
    7 		exit(0);
    8 	}
    9         if ($ENV{PERL_CORE}) {
   10                 chdir 't' if -d 't';
   11                 @INC = '../lib';
   12         }
   13 }
   14 
   15 use Test;
   16 plan tests => 11;
   17 
   18 require MIME::Base64;
   19 require MIME::QuotedPrint;
   20 
   21 eval {
   22     my $tmp = MIME::Base64::encode(v300);
   23     print "# enc: $tmp\n";
   24 };
   25 print "# $@" if $@;
   26 ok($@);
   27 
   28 eval {
   29     my $tmp = MIME::QuotedPrint::encode(v300);
   30     print "# enc: $tmp\n";
   31 };
   32 print "# $@" if $@;
   33 ok($@);
   34 
   35 if (defined &utf8::is_utf8) {
   36     my $str = "aaa" . v300;
   37     ok(utf8::is_utf8($str));
   38     chop($str);
   39     ok(utf8::is_utf8($str));
   40     ok(MIME::Base64::encode($str, ""), "YWFh");
   41     ok(utf8::is_utf8($str));
   42     ok(MIME::QuotedPrint::encode($str), "aaa=\n");
   43     ok(utf8::is_utf8($str));
   44 
   45     utf8::downgrade($str);
   46     ok(!utf8::is_utf8($str));
   47     ok(MIME::Base64::encode($str, ""), "YWFh");
   48     ok(!utf8::is_utf8($str));
   49 }
   50 else {
   51     skip("Missing is_utf8") for 1..9;
   52 }