- Clone all 5 Zonemaster component repos (LDNS, Engine, CLI, Backend, GUI) - Dockerfile.backend: 8-stage multi-stage build LDNS→Engine→CLI→Backend - Dockerfile.gui: Astro static build served via nginx - docker-compose.yml: backend (internal) + frontend (port 5353) - nginx.conf: root redirects to /es/, /api/ proxied to backend - zonemaster-gui/config.ts: defaultLanguage set to 'es' (Spanish) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
784 B
Perl
31 lines
784 B
Perl
use Test::More;
|
|
use Test::Fatal;
|
|
use Encode;
|
|
use Devel::Peek;
|
|
use utf8;
|
|
|
|
BEGIN { use_ok( "Zonemaster::LDNS" => qw[:all] ) }
|
|
|
|
no warnings 'uninitialized';
|
|
if (exception {to_idn("whatever")} =~ /libidn2 not installed/) {
|
|
ok(!has_idn(), 'No IDN');
|
|
done_testing;
|
|
exit;
|
|
}
|
|
|
|
ok(has_idn(), 'Has IDN');
|
|
my $encoded = to_idn( 'annaröd.se' );
|
|
is( $encoded, 'xn--annard-0xa.se', 'One name encoded right' );
|
|
|
|
my @before = ('annaröd.se', 'rindlöw.se', 'räksmörgås.se', 'nic.中國', 'iis.se');
|
|
my @many = to_idn @before;
|
|
is_deeply(
|
|
\@many,
|
|
[qw( xn--annard-0xa.se xn--rindlw-0xa.se xn--rksmrgs-5wao1o.se nic.xn--fiqz9s iis.se )],
|
|
'Many encoded right'
|
|
);
|
|
|
|
like( exception { to_idn( "ö" x 63 ) }, qr/IDN2_PUNYCODE_/i, 'croaks on IDN encoding failures' );
|
|
|
|
done_testing;
|