initial commit
[urisagit/File-Slurp.git] / t / stdin.t
1 #!/usr/local/bin/perl -w
2
3 use strict ;
4
5 use Carp ;
6 use Socket ;
7 use Symbol ;
8 use Test::More tests => 7 ;
9
10 BEGIN{ 
11         use_ok( 'File::Slurp', ) ;
12 }
13
14 my $data = <<TEXT ;
15 line 1
16 more text
17 TEXT
18
19 foreach 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 }