Blame t/seekable.t

Packit a89ea5
#  -*- perl -*-
Packit a89ea5
# Before `make install' is performed this script should be runnable with
Packit a89ea5
# `make test'. After `make install' it should work as `perl File-Temp.t'
Packit a89ea5
Packit a89ea5
#########################
Packit a89ea5
Packit a89ea5
# change 'tests => 1' to 'tests => last_test_to_print';
Packit a89ea5
Packit a89ea5
use Test::More tests => 10;
Packit a89ea5
BEGIN { use_ok('File::Temp') };
Packit a89ea5
Packit a89ea5
#########################
Packit a89ea5
Packit a89ea5
# Insert your test code below, the Test::More module is use()ed here so read
Packit a89ea5
# its man page ( perldoc Test::More ) for help writing this test script.
Packit a89ea5
Packit a89ea5
# make sure we can create a tmp file...
Packit a89ea5
$tmp = File::Temp->new;
Packit a89ea5
isa_ok( $tmp, 'File::Temp' );
Packit a89ea5
isa_ok( $tmp, 'IO::Handle' );
Packit a89ea5
SKIP: {
Packit a89ea5
  skip "->isa is broken on 5.6.0", 1 if $] == 5.006000;
Packit a89ea5
  isa_ok( $tmp, 'IO::Seekable' );
Packit a89ea5
}
Packit a89ea5
Packit a89ea5
# make sure the seek method is available...
Packit a89ea5
# Note that we need a reasonably modern IO::Seekable
Packit a89ea5
SKIP: {
Packit a89ea5
  skip "IO::Seekable is too old", 1 if IO::Seekable->VERSION <= 1.06;
Packit a89ea5
  ok( File::Temp->can('seek'), 'tmp can seek' );
Packit a89ea5
}
Packit a89ea5
Packit a89ea5
# make sure IO::Handle methods are still there...
Packit a89ea5
ok( File::Temp->can('print'), 'tmp can print' );
Packit a89ea5
Packit a89ea5
# let's see what we're exporting...
Packit a89ea5
$c = scalar @File::Temp::EXPORT;
Packit a89ea5
$l = join ' ', @File::Temp::EXPORT;
Packit a89ea5
ok( $c == 9, "really exporting $c: $l" );
Packit a89ea5
Packit a89ea5
ok(defined eval { SEEK_SET() }, 'SEEK_SET defined by File::Temp') or diag $@;
Packit a89ea5
ok(defined eval { SEEK_END() }, 'SEEK_END defined by File::Temp') or diag $@;
Packit a89ea5
ok(defined eval { SEEK_CUR() }, 'SEEK_CUR defined by File::Temp') or diag $@;