BEGIN {
chdir 't' if -d 't';
@INC = qw(. ../lib);
+ require "test.pl";
+ skip_all_without_perlio();
}
use Config;
-require "test.pl";
my $file = tempfile();
-if (find PerlIO::Layer 'perlio') {
+{
plan(tests => 16);
ok(open(FOO,">:crlf",$file));
ok(print FOO 'a'.((('a' x 14).qq{\n}) x 2000) || close(FOO));
}
}
}
-else {
- skip_all("No perlio, so no :crlf");
-}
sub count_chars {
my($text, $chars) = @_;
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
- skip_all('not perlio') unless (find PerlIO::Layer 'perlio');
+ skip_all_without_perlio();
# FIXME - more of these could be tested without Encode or full perl
skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
skip_all_without_extension('Encode');
chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
- unless (find PerlIO::Layer 'perlio') {
- print "1..0 # Skip: PerlIO not used\n";
- exit 0;
- }
require './test.pl';
+ skip_all_without_perlio();
}
plan tests => 42;
chdir 't' if -d 't';
@INC = '../lib';
require "../t/test.pl";
- skip_all("No perlio") unless (find PerlIO::Layer 'perlio');
+ skip_all_without_perlio();
plan (15);
}
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
- skip_all('not perlio') unless (find PerlIO::Layer 'perlio');
+ skip_all_without_perlio();
skip_all_if_miniperl("no dynamic loading on miniperl, no Fcntl");
skip_all_without_extension('Fcntl'); # how did you get this far?
}
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
- unless (find PerlIO::Layer 'perlio') {
- print "1..0 # Skip: not perlio\n";
- exit 0;
- }
+ require './test.pl';
+ skip_all_without_perlio();
}
no utf8; # needed for use utf8 not griping about the raw octets
-BEGIN { require "./test.pl"; }
plan(tests => 55);
@INC = qw(. ../lib);
require 'test.pl';
skip_all_if_miniperl('no dynamic loading on miniperl, no Filter::Util::Call');
- unless (find PerlIO::Layer 'perlio') {
- print "1..0 # Skip: not perlio\n";
- exit 0;
- }
+ skip_all_without_perlio();
}
use strict;
use Config;
@INC = '../lib';
require "./test.pl";
- unless (find PerlIO::Layer 'perlio') {
- print "1..0 # Skip: not perlio\n";
- exit 0;
- }
+ skip_all_without_perlio();
skip_all_if_miniperl('-C and $ENV{PERL_UNICODE} are disabled on miniperl');
}
skip_all("$extension was not built");
}
+sub skip_all_without_perlio {
+ skip_all('no PerlIO') unless PerlIO::Layer->find('perlio');
+}
+
sub _ok {
my ($pass, $where, $name, @mess) = @_;
# Do not try to microoptimize by factoring out the "not ".