=head1 Name

punycode


=head1 Ziel

Testen der Codierung von Domainnamen.


=head1 Testfälle

Es wird getestet:


=head2 

Encode und Decode


=head1 nicht-Testfälle

Folgende Dinge sind noch nicht im Test:

=over 4

=item *

Unicode -- momentan sind das alles UTF8-Bytestrings

=item *

Normalisierung

=back


=cut


package Test::Punycode;
use utf8;
use warnings;
use strict; use warnings; use utf8;
BEGIN { unshift(@INC,($ENV{'POPHOME'}||'@POPHOME@').'/lib')
			unless $ENV{'KUNDE_NO_PERLPATH'};
      }

use Test::More tests => 6; $|=1;
BEGIN { $ENV{'DbLocalCf'}=1; }
use Dbase::Test;
use Dbase::Globals qw(puny_encode puny_decode);

my $PUNY="xn--";

my $test1="".$PUNY."umlaut--cxa6n9b.de";
my $test1_latin1="umlaut-äöü.de";

my $test2="soso.".$PUNY."umlaut-gua8l4b.de";
#my $test2_utf8="soso.umlaut\xc3\xa4\xc3\xb6\xc3\xbc.de";
my $test2_latin1="soso.umlautäöü.de";

my $test3="laut.de";

#is puny_encode($test1_utf8), $test1;
#is puny_encode($test2_utf8), $test2;
#is puny_decode($test1), $test1_utf8;
#is puny_decode($test2), $test2_utf8;

is puny_encode($test1_latin1,1), $test1;
is puny_encode($test2_latin1,1), $test2;
is puny_decode($test1,1), $test1_latin1;
is puny_decode($test2,1), $test2_latin1;

#is puny_decode(puny_encode($test1_utf8),1), $test1_latin1;
#is puny_decode(puny_encode($test2_utf8),1), $test2_latin1;
#is puny_decode(puny_encode($test1_latin1,1)), $test1_utf8;
#is puny_decode(puny_encode($test2_latin1,1)), $test2_utf8;
#
is puny_encode($test3), $test3;
is puny_decode($test3), $test3;
