test_start_limit($input, 1, $size + 2, $size);
ok(my $s = $input->stats, 'stats');
-diag "stats:\n$s";
+diag "stats:\n$s" if ($debug);
$module = 'WebPAC::Input::MARC';
diag "testing with $module";
modify_records => {
200 => {
'*' => { '^c' => '. ' },
+ '^f' => { ' : ' => ' / ' },
}
},
), "open modify_isis (with modify_records)");
ok(my $rec = $input->fetch, 'fetch');
+diag "fetched rec field 200 = ", dump($rec->{200}) if ($debug);
cmp_ok($rec_p->{200}->[0]->{f} . '. ' . $rec_p->{200}->[0]->{c}, 'eq' ,$rec->{200}->[0]->{f}, 'modify_records working');
-diag dump($input);
+diag "input = ",dump($input->{data}) if ($debug);
# break encapsulation, bad! bad!
-$input->{ll_db}->{record} = {
+$input->{ll_db}->{_isis_db}->{record} = {
900 => 'foo ; bar ; baz',
};
$input->{modify_record} = {
900 => {
- '*' => {
- ' ; ' => 'a',
- }
+ '*' => [
+ { ' ; ' => 'a' },
+ { ' ; ' => 'b' },
+ { ' ; ' => 'c' },
+ ],
}
};
-diag "hacked: ",dump($input, $input->fetch);
+diag "hacked: ",dump($input, $input->fetch) if ($debug);
+
+# seek
+throws_ok { $input->seek } qw/without/, 'seek without position';
+cmp_ok($input->seek(0), '==', -1, 'seek');
+
+ok(my $rec = $input->fetch, 'fetch');
+diag "fetched rec = ", dump($rec) if ($debug);