1
# Before `make install' is performed this script should be runnable with
2
# `make test'. After `make install' it should work as `perl Gscan2pdf.t'
4
#########################
6
# change 'tests => 1' to 'tests => last_test_to_print';
8
use Test::More tests => 1;
11
use Gscan2pdf::Document;
14
#########################
16
# Insert your test code below, the Test::More module is use()ed here so read
17
# its man page ( perldoc Test::More ) for help writing this test script.
19
# Thumbnail dimensions
23
use Log::Log4perl qw(:easy);
24
Log::Log4perl->easy_init($DEBUG);
25
our $logger = Log::Log4perl::get_logger;
26
my $prog_name = 'gscan2pdf';
27
use Locale::gettext 1.05; # For translations
28
our $d = Locale::gettext->domain($prog_name);
29
Gscan2pdf->setup($d, $logger);
32
system('convert rose: test.pnm');
34
my $slist = Gscan2pdf::Document->new;
35
$slist->get_file_info( 'test.pnm', undef, undef, undef, sub {
37
$slist->import_file( $info, 1, 1, undef, undef, undef, sub {
38
$slist->to_tiff($slist->{data}[0][2], undef, undef, undef, undef, undef, sub {
39
is( -s 'test.pnm', -s "$slist->{data}[0][2]{filename}", 'image not modified' );
42
$slist->{cancelled} = 1;
47
#########################