zonemaster / zonemaster-ldns

A Perl interface module for Zonemaster to NLnet Labs' ldns library
Other
8 stars 12 forks source link

Unit test t/idn.t is locale dependent #102

Closed matsduf closed 4 years ago

matsduf commented 4 years ago

Trying to install Zonemaster-LDNS with cpanm on a FreeBSD 11.3 system from a Zonemaster-LDNS distribution file (as if from CPAN).

"/usr/local/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t
t/axfr.t ........... ok   
t/dnssec.t ......... ok    
t/idn.t ............ 1/? 
#   Failed test 'Boom today'
#   at t/idn.t line 28.
#                   'Error: Misslyckades med punycode
# '
#     doesn't match '(?^:Punycode)'
# Looks like you failed 1 test of 5.
t/idn.t ............ Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/5 subtests 

Running locale will report:

LANG=sv_SE.UTF-8
LC_CTYPE="sv_SE.UTF-8"
LC_COLLATE="sv_SE.UTF-8"
LC_TIME="sv_SE.UTF-8"
LC_NUMERIC="sv_SE.UTF-8"
LC_MONETARY="sv_SE.UTF-8"
LC_MESSAGES="sv_SE.UTF-8"
LC_ALL=

Last test in t/idn.t says

like( exception { to_idn( "ö" x 63 ) }, qr/Punycode/, 'Boom today' );

and assums that the error message from the code contains the string "Punycode". Well, it depends.

Locale == C:

Error: Punycode failed

Locale == sv_SE.UTF-8

Error: Misslyckades med punycode

In all cases inspected, either "punycode" or "Punycode" was found.

matsduf commented 4 years ago

Fixed by #103.