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 => 16;
9
BEGIN { use_ok('Gscan2pdf') };
11
#########################
13
# Insert your test code below, the Test::More module is use()ed here so read
14
# its man page ( perldoc Test::More ) for help writing this test script.
16
my $filename = 'scanners/Brother_MFC_5100c';
17
my $output = do { local( @ARGV, $/ ) = $filename ; <> } ;
18
my %this = Gscan2pdf::options2hash($output);
21
'tip' => 'Selects the scan source (such as a document-feeder).',
22
'default' => 'Automatic Document Feeder',
23
'values' => 'FlatBed|Automatic Document Feeder'
26
'tip' => 'Controls the brightness of the acquired image.',
27
'default' => 'inactive',
28
'values' => '-50..50% (in steps of 1)'
31
'tip' => 'Select the scan mode',
32
'default' => '24bit Color',
33
'values' => 'Black & White|Gray[Error Diffusion]|True Gray|24bit Color'
36
'tip' => 'Sets the resolution of the scanned image.',
38
'values' => '100|150|200|300|400|600|1200|2400|4800|9600dpi'
41
'tip' => 'Controls the contrast of the acquired image.',
42
'default' => 'inactive',
43
'values' => '-50..50% (in steps of 1)'
46
foreach my $option (keys %this) {
47
foreach (qw(tip default values)) {
48
is ($this{$option}{$_}, $that{$option}{$_}, "$option, $_");
51
eq_hash(\%this, \%that);