added checking the result of atomic rename in write_file
[urisagit/Perl-Docs.git] / t / stdin.t
CommitLineData
635c7876 1#!/usr/local/bin/perl -w
2
3use strict ;
4
5use Carp ;
6use Socket ;
7use Symbol ;
8use Test::More tests => 7 ;
9
10BEGIN{
11 use_ok( 'File::Slurp', ) ;
12}
13
14my $data = <<TEXT ;
15line 1
16more text
17TEXT
18
19foreach my $file ( qw( stdin STDIN stdout STDOUT stderr STDERR ) ) {
20
21 write_file( $file, $data ) ;
22 my $read_buf = read_file( $file ) ;
23 is( $read_buf, $data, 'read/write of file [$file]' ) ;
24
25 unlink $file ;
26}