This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
It's not necessary to hardcode skipping of benchmark tests in them
[perl5.git] / t / io / errno.t
CommitLineData
d7dfc388
SK
1#!./perl
2# vim: ts=4 sts=4 sw=4:
3
4# $! may not be set if EOF was reached without any error.
5# http://rt.perl.org/rt3/Ticket/Display.html?id=39060
6
7use strict;
8require './test.pl';
9
10plan( tests => 16 );
11
12my $test_prog = 'while(<>){print}; print $!';
13
14for my $perlio ('perlio', 'stdio') {
15 $ENV{PERLIO} = $perlio;
16 for my $test_in ("test\n", "test") {
17 my $test_in_esc = $test_in;
18 $test_in_esc =~ s/\n/\\n/g;
19 for my $rs_code ('', '$/=undef', '$/=\2', '$/=\1024') {
20 is( runperl( prog => "$rs_code; $test_prog",
21 stdin => $test_in, stderr => 1),
22 $test_in,
23 "Wrong errno, PERLIO=$ENV{PERLIO} stdin='$test_in_esc'");
24 }
25 }
26}