$qp->add_boolean_prefix($name, $_) foreach split(/ /, $prefix);
}
- if (my $extra = $self->{-extra}) {
- my $user_pfx = $self->{-user_pfx} = [];
- for my $x (@$extra) {
- push @$user_pfx, $x->user_help;
- my $m = $x->query_parser_method;
- $qp->$m(@$x{qw(prefix xprefix)});
- }
- chomp @$user_pfx;
+ for my $x (@{$self->{-extra} // []}) {
+ my $m = $x->query_parser_method;
+ $qp->$m(@$x{qw(prefix xprefix)});
}
-
while (my ($name, $prefix) = each %prob_prefix) {
$qp->add_prefix($name, $_) foreach split(/ /, $prefix);
}
}
sub help_txt {
- my ($self) = @_;
- $self->{qp} // $self->qparse_new; # parse altids + indexheaders
- help2txt(@HELP, @{$self->{-user_pfx} // []});
+ help2txt(@HELP, map { $_->user_help } @{$_[0]->{-extra} // []});
}
# always returns a scalar value
is $res->code, 200, 'altid search hit';
$res = $cb->(GET('/test/?q=xyz:10'));
is $res->code, 404, 'altid search miss';
+ $res = $cb->(GET('/test/_/text/help/'));
+ is $res->code, 200, 'altid help hit';
+ like $res->content, qr/\b$aid:/, 'altid shown in help';
};
test_psgi(sub { $www->call(@_) }, $client);
SKIP: {