ct;
use warnings;
use Carp;
use Groonga::API;
use Groonga::API::Constants qw/GRN_CTX_USE_QL/;
use JSON::XS ();
no bytes;
use constant DEFAULT_PORT => 10041;
our $VERSION = $Groonga::API::VERSION;
s
x, $host, $port, 0);
croak "failed to connect to $host:$port ($rc)" if $rc;
}
$args{_json} = JSON::XS->new->utf8($args{encoding} ? 1 : 0);
bless \%args, $class;
}
sub do {
my ($self, @a
($self->{encoding}) {
$res = Encode::decode($self->{encoding}, $res);
}
eval { $self->{_json}->decode($res) } || $res;
}
sub ctx { shift->{_ctx} }
sub db { shift->{_db} }
sub DESTROY {
PI::Test;
use strict;
use warnings;
use base 'Exporter';
use Test::More;
use Path::Extended;
use JSON::XS;
use Groonga::API;
use Groonga::API::Constants qw/:all/;
use version;
no bytes;
our @EXPORT
n_test
indexed_table_test
load_into_table
version_ge
/,
@Test::More::EXPORT,
@JSON::XS::EXPORT,
@Groonga::API::Constants::EXPORT_OK,
);
our %TMPDIR;
our $ROOT;
sub version_ge {
table";
my $json = encode_json($data);
my $rc = Groonga::API::load($ctx, GRN_CONTENT_JSON,
$table_name, bytes::length($table_name),
undef, 0,
$json, bytes::length($json),
undef, 0