File: pseudo.t

package info (click to toggle)
libfile-slurp-perl 9999.19-4
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 340 kB
  • ctags: 40
  • sloc: perl: 1,671; makefile: 39
file content (34 lines) | stat: -rw-r--r-- 555 bytes parent folder | download | duplicates (3)
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
#!/usr/local/bin/perl -w

use strict ;

use File::Slurp ;
use Carp ;
use Test::More ;

plan( tests => 1 ) ;

my $proc_file = "/proc/$$/auxv" ;

SKIP: {

	unless ( -r $proc_file ) {

		skip "can't find pseudo file $proc_file", 1 ;
	}

	test_pseudo_file() ;
}

sub test_pseudo_file {

	my $data_do = do{ local( @ARGV, $/ ) = $proc_file; <> } ;

#print "LEN: ", length $data_do, "\n" ;

	my $data_slurp = read_file( $proc_file ) ;
#print "LEN2: ", length $data_slurp, "\n" ;
#print "LEN3: ", -s $proc_file, "\n" ;

	is( $data_do, $data_slurp, 'pseudo' ) ;
}