diff --git a/xapian-bindings/perl/t/parser.t b/xapian-bindings/perl/t/parser.t
index 88a62a93ffef..69cda06544fa 100644
--- a/xapian-bindings/perl/t/parser.t
+++ b/xapian-bindings/perl/t/parser.t
@@ -2,6 +2,26 @@ use strict;
 # Before 'make install' is performed this script should be runnable with
 # 'make test'. After 'make install' it should work as 'perl test.pl'
 
+package MyRP;
+
+our @ISA = qw(Xapian::RangeProcessor);
+
+sub new {
+    my $class = shift;
+    my $self = Xapian::RangeProcessor->new(); # {@_};
+    bless $self, $class;
+    return $self;
+}
+
+sub __call__ {
+    my ($self, $a, $b) = @_;
+    return Xapian::Query->new("spam");
+}
+
+1;
+
+package main;
+
 # FIXME: these tests pass in the XS version.
 my $disable_fixme = 1;
 
@@ -112,6 +132,10 @@ $qp->add_rangeprocessor( $rp6 );
 $qp->add_rangeprocessor( $rp7 );
 $qp->add_rangeprocessor( $rp3 );
 
+my $myrp = MyRP->new();
+
+$qp->add_rangeprocessor( $myrp );
+
 $qp->add_boolean_prefix("test", "XTEST");
 
 foreach $pair (
