Ticket #221: test

File test, 633 bytes (added by Adam Sjøgren, 17 years ago)

Minimal test-script that coredumps

Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Search::Xapian qw(:standard); # libsearch-xapian-perl 1.0.4.0-2 from Debian unstable
7
8$|=1;
9
10# These all work:
11test_query('something other* this more');
12test_query('other* this AND more');
13test_query('something other this AND more');
14test_query('something other* this more');
15
16# This query throws a Xapian::QueryParserError and core dumps:
17test_query('something other* this AND more');
18
19
20sub test_query {
21 my ($q)=@_;
22
23 print "'$q' ";
24
25 my $query_parser=Search::Xapian::QueryParser->new;
26
27 $query_parser->parse_query($q, FLAG_BOOLEAN|FLAG_WILDCARD);
28
29 print "[ok]\n";
30}