105 |
test_start_limit($input, 1, $size + 2, $size); |
test_start_limit($input, 1, $size + 2, $size); |
106 |
|
|
107 |
ok(my $s = $input->stats, 'stats'); |
ok(my $s = $input->stats, 'stats'); |
108 |
diag "stats:\n$s"; |
diag "stats:\n$s" if ($debug); |
109 |
|
|
110 |
$module = 'WebPAC::Input::MARC'; |
$module = 'WebPAC::Input::MARC'; |
111 |
diag "testing with $module"; |
diag "testing with $module"; |
132 |
modify_records => { |
modify_records => { |
133 |
200 => { |
200 => { |
134 |
'*' => { '^c' => '. ' }, |
'*' => { '^c' => '. ' }, |
135 |
|
'^f' => { ' : ' => ' / ' }, |
136 |
} |
} |
137 |
}, |
}, |
138 |
), "open modify_isis (with modify_records)"); |
), "open modify_isis (with modify_records)"); |
139 |
|
|
140 |
ok(my $rec = $input->fetch, 'fetch'); |
ok(my $rec = $input->fetch, 'fetch'); |
141 |
|
diag "fetched rec field 200 = ", dump($rec->{200}) if ($debug); |
142 |
|
|
143 |
cmp_ok($rec_p->{200}->[0]->{f} . '. ' . $rec_p->{200}->[0]->{c}, 'eq' ,$rec->{200}->[0]->{f}, 'modify_records working'); |
cmp_ok($rec_p->{200}->[0]->{f} . '. ' . $rec_p->{200}->[0]->{c}, 'eq' ,$rec->{200}->[0]->{f}, 'modify_records working'); |
144 |
|
|
145 |
diag dump($input); |
diag "input = ",dump($input->{data}) if ($debug); |
146 |
|
|
147 |
# break encapsulation, bad! bad! |
# break encapsulation, bad! bad! |
148 |
$input->{ll_db}->{record} = { |
$input->{ll_db}->{_isis_db}->{record} = { |
149 |
900 => 'foo ; bar ; baz', |
900 => 'foo ; bar ; baz', |
150 |
}; |
}; |
151 |
|
|
152 |
$input->{modify_record} = { |
$input->{modify_record} = { |
153 |
900 => { |
900 => { |
154 |
'*' => { |
'*' => [ |
155 |
' ; ' => 'a', |
{ ' ; ' => 'a' }, |
156 |
} |
{ ' ; ' => 'b' }, |
157 |
|
{ ' ; ' => 'c' }, |
158 |
|
], |
159 |
} |
} |
160 |
}; |
}; |
161 |
|
|
162 |
diag "hacked: ",dump($input, $input->fetch); |
diag "hacked: ",dump($input, $input->fetch) if ($debug); |
163 |
|
|
164 |
|
# seek |
165 |
|
throws_ok { $input->seek } qw/without/, 'seek without position'; |
166 |
|
cmp_ok($input->seek(0), '==', -1, 'seek'); |
167 |
|
|
168 |
|
ok(my $rec = $input->fetch, 'fetch'); |
169 |
|
diag "fetched rec = ", dump($rec) if ($debug); |