1 #!/usr/local/bin/perl -w
6 use POSIX qw( :fcntl_h ) ;
7 use Test::More tests => 2 ;
9 # in case SEEK_SET isn't defined in older perls. it seems to always be 0
13 *SEEK_SET = sub { 0 } unless eval { SEEK_SET() } ;
17 use_ok( 'File::Slurp', ) ;
24 skip <<TEXT, 1 if $@ ;
25 B.pm not found in this Perl. Note this will cause slurping of
26 the DATA handle to fail.
29 test_data_scalar_slurp() ;
38 sub test_data_scalar_slurp {
40 my $data_seek = tell( \*DATA );
42 # first slurp in the text
44 my $slurp_text = read_file( \*DATA ) ;
46 # now we need to get the golden data
48 seek( \*DATA, $data_seek, SEEK_SET ) || die "seek $!" ;
49 my $data_text = join( '', <DATA> ) ;
51 is( $slurp_text, $data_text, 'scalar slurp of DATA' ) ;
62 we can't test long handle slurps from DATA since i would have to type