clean up reporter share withs in remove ou scripts
[migration-tools.git] / Equinox-Migration / t / 04-MARCXMLSampler.t
1 #!perl -T
2
3 #use Test::More tests => 39;
4 use Test::More qw(no_plan);
5 use Equinox::Migration::MARCXMLSampler;
6
7 # fails
8 eval { my $mp =
9          Equinox::Migration::MARCXMLSampler->new(tagfile => 't/corpus/mdmpmap-00.txt') };
10 is ($@, "Argument 'marcfile' must be specified\n", 'no marcfile');
11
12
13 # baseline object creation
14 my $mp = Equinox::Migration::MARCXMLSampler->new( marcfile  => 't/corpus/mdmp-0.txt');
15 is(ref $mp, "Equinox::Migration::MARCXMLSampler", "self is self");
16
17 # simple, original sample tests inherited from MDMP
18 $mp = Equinox::Migration::MARCXMLSampler->new( marcfile  => 't/corpus/mdmp-0.txt',
19                                                mapstring => '999',
20                                              );
21 my $sample = $mp->{data}{samp};
22 is (defined $sample->{999}, 1);
23 is (defined $sample->{999}{x}, 1);
24 is ($sample->{999}{x}{value}, 'MYSTERY', 'Should be the first seen value');
25 is ($sample->{999}{x}{count}, 7, 'One real in each record, plus 3 synthetic in last rec');
26 is ($sample->{999}{x}{tcnt}, 4, 'Occurs in all records');
27 is ($sample->{999}{s}{tcnt}, 3, 'Was removed from one record');
28
29 my $tags = $mp->{data}{tags};
30 is ($tags->{961}, 4);
31 is ($tags->{250}, 1);