~ubuntu-branches/ubuntu/utopic/libmarc-lint-perl/utopic

« back to all changes in this revision

Viewing changes to t/test880and6.t

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Yu, Jonathan Yu, gregor herrmann, Nathan Handler
  • Date: 2009-08-29 19:04:20 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090829190420-xsn11r3d5vznf8ak
Tags: 1.44-1
[ Jonathan Yu ]
* New upstream release (IMPORTANT FIXES)
  + _check_article now has exceptions: 'A to ', 'A isn\'t '
  + Updated Lint::DATA section with Oct 2007 & 2008 updates
  + Update MARC::Lint::CodeData with most recent version
* Standards-Version 3.8.3 (drop perl version dependency)
* Use short debhelper rules format
* Updated gregoa's email address
* Drop version dependency on libbusiness-isbn-perl (>= 2.03),
  since version 2.03.01 is in stable
* Added myself to Uploaders and Copyright
* Updated to machine-readable copyright format
* Refreshed dam's patch for whatis, added headers per DEP3
* Compacted control description

[ gregor herrmann ]
* debian/watch: use dist-based URL.
* Add debian/README.source to document quilt usage, as required by
  Debian Policy since 3.8.0.
* debian/control: Changed: Switched Vcs-Browser field to ViewSVN
  (source stanza).

[ Nathan Handler ]
* debian/watch: Update to ignore development releases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!perl
2
2
 
 
3
 
 
4
 
3
5
#Tests for field 880 and for subfield 6
4
6
 
 
7
 
 
8
 
5
9
use strict;
 
10
 
6
11
use warnings;
 
12
 
7
13
use File::Spec;
 
14
 
8
15
use Test::More tests=>6;
9
16
 
 
17
 
 
18
 
10
19
BEGIN { use_ok( 'MARC::File::USMARC' ); }
 
20
 
11
21
BEGIN { use_ok( 'MARC::Lint' ); }
12
22
 
 
23
 
 
24
 
13
25
FROM_TEXT: {
 
26
 
14
27
    my $marc = MARC::Record->new();
 
28
 
15
29
    isa_ok( $marc, 'MARC::Record', 'MARC record' );
16
30
 
 
31
 
 
32
 
17
33
    $marc->leader("00000nam  22002538a 4500"); 
18
34
 
 
35
 
 
36
 
19
37
    my $nfields = $marc->add_fields(
 
38
 
20
39
        ['001', 'ttt07000001 '],
 
40
 
21
41
        ['003', 'TEST '],
 
42
 
22
43
        ['008', '070520s2007    ilu           000 0 eng d',
 
44
 
23
45
        ],
 
46
 
24
47
        ['040', "", "",
 
48
 
25
49
            a => 'TEST',
 
50
 
26
51
            c => 'TEST',
 
52
 
27
53
         ],
 
54
 
28
55
        ['050', "", "4",
 
56
 
29
57
            a => 'RZ999',
 
58
 
30
59
            b => '.J66 2007',
 
60
 
31
61
         ],
 
62
 
32
63
        ['082', "0", "4",
 
64
 
33
65
            a => '615.8/9',
 
66
 
34
67
            2 => '22'
 
68
 
35
69
         ],
 
70
 
36
71
        [100, "1","", 
 
72
 
37
73
            a => "Jones, John.",
 
74
 
38
75
        ],
 
76
 
39
77
        [245, "1","0",
 
78
 
40
79
            6 => "880-02",
 
80
 
41
81
            a => "Test 880.",
 
82
 
42
83
        ],
 
84
 
43
85
        [260, "", "",
 
86
 
44
87
            a => "Mount Morris, Ill. :",
 
88
 
45
89
            b => "B. Baldus,",
 
90
 
46
91
            c => "2007.",
 
92
 
47
93
            ],
 
94
 
48
95
        [300, "", "",
 
96
 
49
97
            a => "1 v. ;",
 
98
 
50
99
            c => "23 cm.",
 
100
 
51
101
        ],
 
102
 
52
103
        [880, "1", "0",
 
104
 
53
105
            6 => '245-02/$1',
 
106
 
54
107
            a => "<Title in CJK script>.",
 
108
 
55
109
        ],
 
110
 
56
111
    );
 
112
 
57
113
    is( $nfields, 11, "All the fields added OK" );
58
114
 
 
115
 
 
116
 
59
117
    my @expected = (
 
118
 
60
119
#        (undef),
 
120
 
61
121
        #q{},
 
122
 
62
123
    );
63
124
 
 
125
 
 
126
 
64
127
    my $lint = new MARC::Lint;
 
128
 
65
129
    isa_ok( $lint, 'MARC::Lint' );
66
130
 
 
131
 
 
132
 
67
133
    $lint->check_record( $marc );
 
134
 
68
135
    my @warnings = $lint->warnings;
 
136
 
69
137
    while ( @warnings ) {
 
138
 
70
139
        my $expected = shift @expected;
 
140
 
71
141
        my $actual = shift @warnings;
72
142
 
 
143
 
 
144
 
73
145
        is( $actual, $expected, "Checking expected messages" );
 
146
 
74
147
    }
 
148
 
75
149
    is( scalar @expected, 0, "All expected messages exhausted." );
 
150
 
76
151
}
77
152
 
 
153
 
 
154