2 # =============================================================================
3 # $Id: 04_cql.t,v 1.3 2004-07-28 08:15:47 adam Exp $
6 # =============================================================================
11 push (@INC,'demo','blib/lib','blib/arch');
17 use Test::More tests => 7;
19 # ----------------------------------------------------------------------------
20 # Session opening and closing
24 IDZebra::logFile("test04.log");
25 use_ok('IDZebra::Session');
29 # ----------------------------------------------------------------------------
30 # Session opening and closing
31 my $sess = IDZebra::Session->new();
33 # ----------------------------------------------------------------------------
35 $sess->cqlmap('demo/cql.map');
37 $SIG{__WARN__} = \&catch_warn;
39 &check_cql($sess, "IDZebra", 0);
40 &check_cql($sess, "dc.title=IDZebra", 0);
41 &check_cql($sess, "dc.title=(IDZebra and Session)", 0);
42 &check_cql($sess, "dc.title=IDZebra and Session)", -1);
43 &check_cql($sess, "dc.title='IDZebra::Session'", 0);
44 &check_cql($sess, "anything=IDZebra", 16);
47 my ($sess, $query, $exp) = @_;
48 my ($rpn, $stat) = $sess->cql2pqf($query);
50 ok(($stat == $exp), "Wrong query ($stat): '$query'");
52 ok((($stat == 0) && ($rpn ne "")), "Good query query: '$query'");