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 35 36 37 38
|
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
use File::Spec ();
BEGIN {
# RECOMMEND PREREQ: File::Temp 0.15 - need tempdir
eval "use File::Temp 0.15 'tempdir';";
plan skip_all => "File::Temp 0.15 required for testing" if $@;
plan tests => 8;
}
use PostScript::File 2.00 qw(check_file);
ok(1); # module found
my $ps = PostScript::File->new();
isa_ok($ps, 'PostScript::File'); # object created
my $dir = $ARGV[0] || tempdir(CLEANUP => 1);
my $name = "fi01simple";
my $out = $ps->output( $name, $dir );
ok(1); # survived so far
is($ps->get_filename, undef, 'Did not set filename');
is($out, File::Spec->catfile( $dir, "$name.ps" ), 'expected output filename');
my $file = check_file( "$name.ps", $dir );
ok($file);
ok(-e $file);
# PNG output is disabled
eval { PostScript::File->new(png => 1) };
like($@, qr/^PNG output is no longer supported/, 'no PNG');
|