Opened 8 years ago

Closed 8 years ago

#610 closed defect (fixed)

Search::Xapian 1.2.13 fails tests against perl 5.16.1

Reported by: jbergstroem Owned by: Olly Betts
Priority: normal Milestone: 1.2.14
Component: Search::Xapian Version: 1.2.13
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

Using perl 5.16.1, I get this test failure:

t/10query.t ........... 1/10
#   Failed test at t/10query.t line 37.
#                   'USAGE: Search::Xapian::Query->new('term') or Search::Xapian::Query->new(OP, <args>) at t/10query.t line 34.
# '
#     doesn't match '(?^:^USAGE: Search::Xapian::Query->new\('term'\) or Search::Xapian::Query->new\(OP, <args>\) at \S+/10query\.t line \d+$)'
# Looks like you failed 1 test of 10.

Reduced case (taken from https://bugs.gentoo.org/show_bug.cgi?id=453450)

use Test::More;
BEGIN { plan tests => 1 };

use Search::Xapian qw(:standard);
eval { Search::Xapian::Query->new("hello", 1, 2, 3, 4); };
ok(defined $@, "Bad query ctor threw exception");

reduced test case by Anthony Basile, bug originally found by Diego Elio Pettenò.

Change History (4)

in reply to:  description comment:1 by Anthony G. Basile, 8 years ago

Replying to jbergstroem:

Reduced case (taken from https://bugs.gentoo.org/show_bug.cgi?id=453450)

Actually I cut that off one line too short. The correct reduced case is

use Test::More;
BEGIN { plan tests => 2 };
use Search::Xapian qw(:standard);
use Config;

eval {
    Search::Xapian::Query->new("hello", 1, 2, 3, 4);
};
ok(defined $@, "Bad query ctor threw exception");
like($@, qr!^USAGE: Search::Xapian::Query->new\('term'\) or Search::Xapian::Query->new\(OP, <args>\) at \S+/10query\.t line \d+$!);

comment:2 by Olly Betts, 8 years ago

Milestone: 1.2.14
Resolution: fixed
Status: newclosed

It appears that perl 5.16.1 adds a '.' at the end of this error message which wasn't there with older Perl versions (confirmed with blueness on IRC), so I've adjusted the regexp to optionally allow this in trunk r17039 and 1.2 branch r17040.

comment:3 by Olly Betts, 8 years ago

Resolution: fixed
Status: closedreopened

Apparently that doesn't fix it, according to blueness on IRC.

I don't have easy access to Perl 5.16 currently (it's in debian experimental, but trying to install it wanted to uninstall packages I find rather useful, like xorg), so I'd appreciate it if someone who does could work out why this regex isn't matching.

FWIW, this problem is entirely in the testsuite, so disabling this test is a reasonable workaround.

comment:4 by Olly Betts, 8 years ago

Resolution: fixed
Status: reopenedclosed

I tried the testcase without the Search::Xapian bits with a hand-built Perl 5.16.2 and it passed, so blueness retested and confirmed that the applied fix does actually work:

09:47 < blueness> olly, i applied the patch to 1.2.13 and it works
09:48 < blueness> so i must have done something wrong the first time
09:48 < blueness> to be clear, This is perl 5, version 16, subversion 2 
                  (v5.16.2) built for x86_64-linux
09:48 < blueness> Search-Xapian-1.2.13.0
09:49 < blueness> applied commit 376e1edb from the github git repo

That commit is r17039 in SVN.

Note: See TracTickets for help on using tickets.