1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
# -*- cperl -*-
use lib qw(./blib/lib ../blib/lib);
use strict;
BEGIN { $| = 1; print "1..12\n"; }
use Inline::Files;
# 1..2
open X, ">out.tmp" or die;
print X "ok 2\n";
close X;
print "ok 1\n" if -f "out.tmp";
open Y, "out.tmp" or die;
print <Y>;
close Y;
unlink "out.tmp";
# 3..4
open X, ">", "out.tmp" or die;
print X "ok 4\n";
close X;
print "ok 3\n" if -f "out.tmp";
open Y, "<", "out.tmp" or die;
print <Y>;
close Y;
unlink "out.tmp";
# 5..7
open X, ">out.tmp" or die;
print X "ok 6\n";
close X;
print "ok 5\n" if -f "out.tmp";
open X, ">>out.tmp" or die;
print X "ok 7\n";
close X;
open Y, "out.tmp" or die;
print <Y>;
close Y;
unlink "out.tmp";
# 8..10
open X, ">","out.tmp" or die;
print X "ok 9\n";
close X;
print "ok 8\n" if -f "out.tmp";
open X, ">>","out.tmp" or die;
print X "ok 10\n";
close X;
open Y, "<out.tmp" or die;
print <Y>;
close Y;
unlink "out.tmp";
# 11..12
open X, qq{$^X -e "print 'ok 11'" | } or die "$!";
print <X>, "\n";
close X;
open X, "-|", qq{$^X -e "print 'ok 12'" } or die "$!";
print <X>, "\n";
close X;
|