Subject: | [PATCH] Skip encoding tests if no PerlIO::encoding |
The attached patch skips encoding tests when Perl is built without
PerlIO::encoding.
Otherwise, 'make test' fails with the following errors:
t/encoding...........Unknown PerlIO layer "encoding" at lib/IO/All.pm
line 782.
# Failed test 'Read big5 with different io-s does not match'
# at t/encoding.t line 21.
# 'We are noticing that our Big5 greeting ---
# §A¦n, §Ú¬O¨©º¸¹êÅç«Çªº¤¤¤å»yµ¦X¦¨¨t²Î --- is being garbled in
# '
# ne
# 'We are noticing that our Big5 greeting ---
# §A¦n, §Ú¬O¨©º¸¹êÅç«Çªº¤¤¤å»yµ¦X¦¨¨t²Î --- is being garbled in
# '
t/encoding...........NOK 1/2Unknown PerlIO layer "encoding" at
lib/IO/All.pm line 782.
Unknown PerlIO layer "encoding" at lib/IO/All.pm line 782.
# Failed test 'Big5 text matches utf8 text after read'
# at t/encoding.t line 24.
# got: 'We are noticing that our Big5 greeting ---
# ä½ å¥½, 我是è²çˆ¾å¯¦é©—室的ä¸æ–‡èªžéŸ³åˆæˆç³»çµ± --- is being
garbled in
# '
# expected: 'We are noticing that our Big5 greeting ---
# §A¦n, §Ú¬O¨©º¸¹êÅç«Çªº¤¤¤å»yµ¦X¦¨¨t²Î --- is being garbled in
# '
t/encoding...........NOK 2/2# Looks like you failed 2 tests of 2.
t/encoding...........dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-2
Failed 2/2 tests, 0.00% okay
Subject: | io_all.patch |
diff -urN IO-All-0.38/t/encoding.t IO-All-patched/t/encoding.t
--- IO-All-0.38/t/encoding.t 2007-04-08 21:42:36.000000000 -0400
+++ IO-All-patched/t/encoding.t 2007-04-10 08:33:46.000000000 -0400
@@ -1,6 +1,15 @@
use lib 't', 'lib';
use strict;
use warnings;
+
+BEGIN {
+ eval { require PerlIO::encoding; };
+ if ($@) {
+ print("1..0 # Skip: No PerlIO::encoding\n");
+ exit(0);
+ }
+}
+
use Test::More tests => 2;
use IO_All_Test;