1use strict;
2use utf8;
3use warnings;
4
5BEGIN {
6  binmode STDOUT, ':utf8';
7  binmode STDERR, ':utf8';
8}
9
10use Test::More tests => 3 + 1;
11use Test::NoWarnings;
12
13{
14  $Net::IDN::Punycode::_NO_XS = 1;
15}
16use Net::IDN::UTS46 (':all');
17
18no warnings 'utf8';
19
20my %p = ("TransitionalProcessing" => "0");
21
22is(eval{uts46_to_ascii("xn--0.pt", %p)},	undef,	"to_ascii\(\'xn\-\-0\.pt\'\)\ throws\ error\ A3\ \[data\/IdnaTest\.txt\:256\]") or ($@ and diag($@));
23is(eval{uts46_to_unicode("xn--0.pt", %p)},	undef,	"to_unicode\(\'xn\-\-0\.pt\'\)\ throws\ error\ A3\ \[data\/IdnaTest\.txt\:256\]") or ($@ and diag($@));
24is(eval{Net::IDN::Punycode::decode_punycode(0)}, undef,  "decode_punycode(0) throws error") or ($@ and diag($@));
25
26# Ignore warnings generated by perl core modules on old perl
27Test::NoWarnings->clear_warnings if $^V lt v5.8.7;
28
29exit(0);
30