File: xtra_pp.t

package info (click to toggle)
libnet-idn-encode-perl 2.500-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,820 kB
  • sloc: perl: 416; makefile: 8
file content (29 lines) | stat: -rw-r--r-- 832 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use strict;
use utf8;
use warnings;

BEGIN {
  binmode STDOUT, ':utf8';
  binmode STDERR, ':utf8';
}

use Test::More tests => 3 + 1;
use Test::NoWarnings;

{
  $Net::IDN::Punycode::_NO_XS = 1;
}
use Net::IDN::UTS46 (':all');

no warnings 'utf8';

my %p = ("TransitionalProcessing" => "0");

is(eval{uts46_to_ascii("xn--0.pt", %p)},	undef,	"to_ascii\(\'xn\-\-0\.pt\'\)\ throws\ error\ A3\ \[data\/IdnaTest\.txt\:256\]") or ($@ and diag($@));
is(eval{uts46_to_unicode("xn--0.pt", %p)},	undef,	"to_unicode\(\'xn\-\-0\.pt\'\)\ throws\ error\ A3\ \[data\/IdnaTest\.txt\:256\]") or ($@ and diag($@));
is(eval{Net::IDN::Punycode::decode_punycode(0)}, undef,  "decode_punycode(0) throws error") or ($@ and diag($@));

# Ignore warnings generated by perl core modules on old perl
Test::NoWarnings->clear_warnings if $^V lt v5.8.7;

exit(0);