diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2013-03-25 20:09:46 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2013-03-25 20:09:46 +0000 |
commit | 6eda9412f8dc717200dec22c57afdd2a46edfa8e (patch) | |
tree | c835d11c3e3f90de6a8561320ec54f077bfd358f /gnu/usr.bin/perl/t/io/crlf.t | |
parent | 19adbb7d6dbd1516758cad91978165088a19e917 (diff) |
import perl 5.16.3 from CPAN - worked on by Andrew Fresh and myself
Diffstat (limited to 'gnu/usr.bin/perl/t/io/crlf.t')
-rw-r--r-- | gnu/usr.bin/perl/t/io/crlf.t | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gnu/usr.bin/perl/t/io/crlf.t b/gnu/usr.bin/perl/t/io/crlf.t index 4c97a91eaf1..ff0f2085546 100644 --- a/gnu/usr.bin/perl/t/io/crlf.t +++ b/gnu/usr.bin/perl/t/io/crlf.t @@ -3,15 +3,16 @@ 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)); @@ -29,8 +30,7 @@ if (find PerlIO::Layer 'perlio') { SKIP: { - skip("miniperl can't rely on loading PerlIO::scalar") - if $ENV{PERL_CORE_MINITEST}; + skip_if_miniperl("miniperl can't rely on loading PerlIO::scalar"); skip("no PerlIO::scalar") unless $Config{extensions} =~ m!\bPerlIO/scalar\b!; require PerlIO::scalar; my $fcontents = join "", map {"$_\015\012"} "a".."zzz"; @@ -41,7 +41,7 @@ if (find PerlIO::Layer 'perlio') { seek $fh, $pos, 0; $/ = "\n"; $s = <$fh>.<$fh>; - ok($s eq "\nxxy\n"); + is($s, "\nxxy\n"); } ok(close(FOO)); @@ -66,14 +66,11 @@ if (find PerlIO::Layer 'perlio') { close FOO; print join(" ", "#", map { sprintf("%02x", $_) } unpack("C*", $foo)), "\n"; - ok($foo =~ /\x0d\x0a$/); - ok($foo !~ /\x0d\x0d/); + like($foo, qr/\x0d\x0a$/); + unlike($foo, qr/\x0d\x0d/); } } } -else { - skip_all("No perlio, so no :crlf"); -} sub count_chars { my($text, $chars) = @_; |