This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tidy t/io/crlf.t
authorNicholas Clark <nick@ccl4.org>
Sun, 6 Mar 2011 21:25:47 +0000 (21:25 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 6 Mar 2011 22:48:15 +0000 (22:48 +0000)
Skip a test under minitest using skip_if_miniperl().
Use eq(), like() and unlike() where appropriate, instead of ok().

t/io/crlf.t

index 4c97a91..7eb9a78 100644 (file)
@@ -29,8 +29,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 +40,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,8 +65,8 @@ 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/);
        }
     }
 }