projects
/
ZOOM-Perl-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
af4556e
)
Test for new scan1()
author
mike
<mike>
Mon, 19 Dec 2005 17:39:58 +0000
(17:39 +0000)
committer
mike
<mike>
Mon, 19 Dec 2005 17:39:58 +0000
(17:39 +0000)
t/15-scan.t
patch
|
blob
|
history
t/25-scan.t
patch
|
blob
|
history
diff --git
a/t/15-scan.t
b/t/15-scan.t
index
31d1e13
..
fb2ea32
100644
(file)
--- a/
t/15-scan.t
+++ b/
t/15-scan.t
@@
-1,4
+1,4
@@
-# $Id: 15-scan.t,v 1.6 2005-11-09 17:03:15 mike Exp $
+# $Id: 15-scan.t,v 1.7 2005-12-19 17:39:58 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 15-scan.t'
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 15-scan.t'
@@
-88,10
+88,21
@@
ok(1, "destroyed fourth scanset");
# returns display terms different from its terms.
# returns display terms different from its terms.
+my $use_query_for_scan = 0;
sub scan {
my($conn, $startterm, $nexpected) = @_;
sub scan {
my($conn, $startterm, $nexpected) = @_;
- $ss = Net::Z3950::ZOOM::connection_scan($conn, $startterm);
+ # Alternately use the original scan() interface and new scan1()
+ my $ss;
+ if ($use_query_for_scan) {
+ my $q = Net::Z3950::ZOOM::query_create();
+ Net::Z3950::ZOOM::query_prefix($q, $startterm);
+ $ss = Net::Z3950::ZOOM::connection_scan1($conn, $q);
+ } else {
+ $ss = Net::Z3950::ZOOM::connection_scan($conn, $startterm);
+ }
+ $use_query_for_scan = !$use_query_for_scan;
+
$errcode = Net::Z3950::ZOOM::connection_error($conn, $errmsg, $addinfo);
ok($errcode == 0, "scan for '$startterm'");
$n = Net::Z3950::ZOOM::scanset_size($ss);
$errcode = Net::Z3950::ZOOM::connection_error($conn, $errmsg, $addinfo);
ok($errcode == 0, "scan for '$startterm'");
$n = Net::Z3950::ZOOM::scanset_size($ss);
diff --git
a/t/25-scan.t
b/t/25-scan.t
index
4a51a74
..
c361fc4
100644
(file)
--- a/
t/25-scan.t
+++ b/
t/25-scan.t
@@
-1,4
+1,4
@@
-# $Id: 25-scan.t,v 1.2 2005-11-09 17:08:31 mike Exp $
+# $Id: 25-scan.t,v 1.3 2005-12-19 17:40:04 mike Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 25-scan.t'
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 25-scan.t'
@@
-84,12
+84,22
@@
ok(1, "destroyed fourth scanset");
# Some more testing still to do: see comment in "15-scan.t"
# Some more testing still to do: see comment in "15-scan.t"
+
+my $use_query_for_scan = 0;
sub scan {
my($conn, $startterm, $nexpected) = @_;
my $ss;
sub scan {
my($conn, $startterm, $nexpected) = @_;
my $ss;
- eval { $ss = $conn->scan($startterm) };
+ eval {
+ if ($use_query_for_scan) {
+ my $q = new ZOOM::Query::PQF($startterm);
+ $ss = $conn->scan1($q);
+ } else {
+ $ss = $conn->scan($startterm);
+ }
+ };
ok(!$@, "scan for '$startterm'");
ok(!$@, "scan for '$startterm'");
+ $use_query_for_scan = !$use_query_for_scan;
my $n = $ss->size();
ok(defined $n, "got size");
my $n = $ss->size();
ok(defined $n, "got size");