~jeffreyratcliffe/gscan2pdf/gscan2pdf

« back to all changes in this revision

Viewing changes to t/Brother_MFC_5100c.t

  • Committer: Jeffrey Ratcliffe
  • Date: 2007-07-11 15:08:22 UTC
  • Revision ID: git-v1:f36ac074943136160e87b9f3291b9d340671920f
abstracted options2hash function to library. created test suite

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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'
 
3
 
 
4
#########################
 
5
 
 
6
# change 'tests => 1' to 'tests => last_test_to_print';
 
7
 
 
8
use Test::More tests => 16;
 
9
BEGIN { use_ok('Gscan2pdf') };
 
10
 
 
11
#########################
 
12
 
 
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.
 
15
 
 
16
my $filename = 'scanners/Brother_MFC_5100c';
 
17
my $output = do { local( @ARGV, $/ ) = $filename ; <> } ;
 
18
my %this = Gscan2pdf::options2hash($output);
 
19
my %that = (
 
20
          'source' => {
 
21
                        'tip' => 'Selects the scan source (such as a document-feeder).',
 
22
                        'default' => 'Automatic Document Feeder',
 
23
                        'values' => 'FlatBed|Automatic Document Feeder'
 
24
                      },
 
25
          'brightness' => {
 
26
                            'tip' => 'Controls the brightness of the acquired image.',
 
27
                            'default' => 'inactive',
 
28
                            'values' => '-50..50% (in steps of 1)'
 
29
                          },
 
30
          'mode' => {
 
31
                      'tip' => 'Select the scan mode',
 
32
                      'default' => '24bit Color',
 
33
                      'values' => 'Black & White|Gray[Error Diffusion]|True Gray|24bit Color'
 
34
                    },
 
35
          'resolution' => {
 
36
                            'tip' => 'Sets the resolution of the scanned image.',
 
37
                            'default' => '200',
 
38
                            'values' => '100|150|200|300|400|600|1200|2400|4800|9600dpi'
 
39
                          },
 
40
          'contrast' => {
 
41
                          'tip' => 'Controls the contrast of the acquired image.',
 
42
                          'default' => 'inactive',
 
43
                          'values' => '-50..50% (in steps of 1)'
 
44
                        }
 
45
        );
 
46
foreach my $option (keys %this) {
 
47
 foreach (qw(tip default values)) {
 
48
  is ($this{$option}{$_}, $that{$option}{$_}, "$option, $_");
 
49
 }
 
50
}
 
51
eq_hash(\%this, \%that);