X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=test-pod.pl;h=e37a98d51a28b109a22c2f41c5f36e3021ebc7a8;hp=37d7fabebe6bc26cca03f3248c4b51e3d2c21217;hb=f4ad227f469be5cf0d848e1e7e99f7620abcf4a9;hpb=23efd2b947c0381a176cd629c617cc373b699282 diff --git a/test-pod.pl b/test-pod.pl index 37d7fab..e37a98d 100644 --- a/test-pod.pl +++ b/test-pod.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# $Id: test-pod.pl,v 1.6 2006-05-10 13:38:31 mike Exp $ +# $Id: test-pod.pl,v 1.7 2006-05-10 15:55:19 mike Exp $ # # Run like this: # YAZ_LOG=pod perl -I lib test-pod.pl "bagel.indexdata.com/gils" "bagel.indexdata.com/marc" @@ -9,12 +9,18 @@ use strict; use warnings; use ZOOM::Pod; -ZOOM::Log::mask_str("appl"); +if (@ARGV == 0) { + printf STDERR "Usage: $0 [ ...]\n"; + exit 1; +} + +ZOOM::Log::mask_str("appl"); my $pod = new ZOOM::Pod(@ARGV); $pod->option(elementSetName => "b"); $pod->callback(ZOOM::Event::RECV_SEARCH, \&completed_search); $pod->callback(ZOOM::Event::RECV_RECORD, \&got_record); +#$pod->callback(exception => \&exception_thrown); $pod->search_pqf("the"); my $err = $pod->wait(); die "$pod->wait() failed with error $err" if $err; @@ -51,6 +57,12 @@ sub got_record { return 0; } +sub exception_thrown { + my($conn, $state, $rs, $exception) = @_; + print "Uh-oh! $exception\n"; + return 0; +} + sub request_records { my($conn, $rs, $state, $count) = @_;