File: stdin.t

package info (click to toggle)
libfile-slurp-perl 9999.32-2.1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 412 kB
  • sloc: perl: 650; makefile: 39
file content (24 lines) | stat: -rw-r--r-- 492 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;

use File::Basename ();
use File::Spec ();
use lib File::Spec->catdir(File::Spec->rel2abs(File::Basename::dirname(__FILE__)), 'lib');

use File::Slurp qw(read_file write_file);
use Test::More;

plan tests => 6;

my $data = <<TEXT ;
line 1
more text
TEXT

foreach my $file ( qw(stdin STDIN stdout STDOUT stderr STDERR) ) {
    write_file($file, $data);
    my $read_buf = read_file($file);
    is($read_buf, $data, 'read/write of file [$file]');

    unlink $file;
}