150 |
'^f' => { ' : ' => ' / ' }, |
'^f' => { ' : ' => ' / ' }, |
151 |
} |
} |
152 |
}, |
}, |
153 |
), "open modify_isis (with modify_records)"); |
), "open (with modify_records)"); |
154 |
|
|
155 |
# seek |
# seek |
156 |
throws_ok { $input->seek } qr/without/, 'seek without position'; |
throws_ok { $input->seek } qr/without/, 'seek without position'; |
165 |
'modify 200' |
'modify 200' |
166 |
); |
); |
167 |
|
|
168 |
|
# modify_file |
169 |
|
|
170 |
|
my $modify_file = "$abs_path/conf/modify/test.pl"; |
171 |
|
|
172 |
|
ok($input->open( |
173 |
|
path => "$abs_path/modify_isis/LIBRI", |
174 |
|
modify_file => $modify_file, |
175 |
|
), "open (with modify_file $modify_file)"); |
176 |
|
|
177 |
|
my $f = $WebPAC::Input::Test::filter_coderef; |
178 |
|
ok(ref($f) eq 'CODE', 'filter_coderef'); |
179 |
|
|
180 |
|
diag "regexps = ", dump($input->modify_file_regexps( $modify_file )); |
181 |
|
|
182 |
|
sub test_filter { |
183 |
|
my ($field, $from, $to) = @_; |
184 |
|
cmp_ok( $f->( $from, $field, 1 ), 'eq', $to, "filter $field |$from| -> |$to|" ); |
185 |
|
} |
186 |
|
|
187 |
|
test_filter(200, |
188 |
|
'^a foo ; bar = baz : zzz', |
189 |
|
'^a foo^kbar^dbaz^ezzz', |
190 |
|
); |
191 |
|
|